Like almost everything else, it depends on who you ask.

The Midrash (Yalkut Shimoni on Psalms 25) describes a sort of "panel discussion" in which this question is posed to four different authorities — Wisdom, Prophecy, Torah and G‑d — each of whom gives a different definition of sin.

According to Wisdom sin is a harmful deed. According to Prophecy it is death. Torah sees it as folly. And G‑d sees it as an opportunity.

The philosophical view of sin is that it is a bad idea, like walking barefoot in the snow or eating too many fatty foods. If you do bad things, bad things will happen to you.

Does this mean that Someone sits up there, tabulating sins and dispensing punishments? Well, yes, though it is not as simplistic as a vengeful G‑d getting even with His little earth creatures for daring to defy His instructions. Is frostbite G‑d's punishment for that barefooted walk in the snow? Is heart disease G‑d's revenge for a high cholesterol diet? Ultimately it is, if you accept that everything that happens, happens because G‑d wants it to happen. But what it really means is that G‑d has established certain "laws of nature" that describe the patterns of His actions upon our existence. There are physical laws of nature — the ones that scientists measure and hypothesize. There are also spiritual laws of nature, which dictate that spiritually beneficial deeds bring spiritual benefit, and spiritually detrimental deeds cause spiritual harm. And since our physical existence derives from and mirrors the spiritual reality, a person's spiritual and moral behavior ultimately affects his physical life as well.

Thus King Solomon (who is the source of the "Wisdom" perspective in the above Midrash) states in the book of Proverbs: "Evil pursues iniquity."

"Prophecy" takes this a step further. Sin is not only a harmful deed — it is the ultimately harmful deed. Prophecy (which represents the apogee of man's endeavor to commune with G‑d) defines "life" as connection with G‑d. Sin—man's turning away from G‑d—is a disruption of this connection. Hence, sin is death.

Torah agrees that sin is a harmful deed. It also agrees that it's a disruption of the flow of life from Creator to creation. Indeed, Torah is the source of both Wisdom's perspective and Prophesy's perspective on sin. But Torah also goes beyond them both in recognizing that the soul of man would never willingly and consciously do such a stupid thing.

Sin, says Torah, is an act of folly. The soul loses its head, and in a moment of irrationality and cognitive confusion does something that is contrary to its own true desire. So sin can be transcended, when the soul recognizes and acknowledges the folly of its transgressions and reasserts its true will. Then the true self of the soul comes to light, revealing that the sin was in fact committed only by the soul's most external, malleable self, while its inner self was never involved in the first place.

And what does G‑d say? G‑d, of course, invented the laws of nature (both physical and spiritual) and the Wisdom that recognizes how they operate. G‑d is the source of life, and it is He who decreed that it should flow to the human soul via a channel constructed (or disrupted) by the deeds of man. And G‑d gave us the Torah and its formulae for spiritual sanity, self-discovery and transcendence. So G‑d is the source of the first three perspectives on sin.

But there is a fourth perspective that is G‑d's alone: sin as the opportunity for "return" (teshuvah).

Teshuvah is a process that, in its ultimate form, empowers us to not only transcend our failings but to also redeem them: to literally travel back in time and redefine the essential nature of a past deed, transforming it from evil to good.

To achieve this, we first have to experience the act of transgression as a negative thing. We have to agonize over the utter devastation it has wrecked on our soul. We have to recognize, disavow and renounce its folly. Only then can we can go back and change what we did.

So is sin a bad, harmful deed? Is it the very face of death? Is it mere stupidity, to be shrugged off by an inherently wise and pristine soul? Is it a potent opportunity for conquest and growth? Turns out, it's all four. But it can only be the fourth if it's also the first three.