It literally translates to "It is a sin", and it's often used to express that something is very delicious or enjoyable, almost to the point of being sinful.
For example:
* "¡Es un pecado comer este pastel tan delicioso!" (It's a sin to eat this delicious cake!)
* "El paisaje es un pecado, tan hermoso es." (The scenery is a sin, it's so beautiful.)