Jonathan Edwards explains why Romans 7:8—"But sin, seizing an opportunity through the commandment, produced in me all kinds of covetousness"—happens.
[The] reason why man has the more strong inclination to moral evil when forbidden, is because obedience is submission and subjection, and the commandment is obligation. But natural corruption is against submission and obligation, but loves the lowest kind of liberty as one of those apparent goods that it seeks; and when he disobeys, he looks upon it that he has broke the obligation.
When he thinks of the perpetration of such a lust, and thinks how he is strictly upon pain of damnation forbidden, tied by such strict bonds from it, it makes him exceeding uneasy, the consideration is so against corrupt nature; which uneasiness takes away all liberty of thought, and makes the mind dwell upon nothing but the contrary and supposed good, the liberty, causes [him] to meditate upon the pleasantness of the act, and makes it appear much greater than otherwise it would do.
In other words, when sinners are given God's law, their minds become extremely uneasy thinking about the punishment they will receive when they break it. Then that uneasiness, since it is so intolerable to their fallen minds, leads them to want to think only about something pleasant, especially the thing they are being forbidden to do. And that causes them to exaggerate the sinful pleasure in their minds and think of it as being greater and more desirable than it really is.
To see how this scenario changes for those who have believed in Christ, read the rest of Miscellanies #79.