That's the common way of looking at it, but I've never agreed with that. I know my view isn't widely shared so I'm not trying to call you wrong or anything, but:
Would you ever steal a candy bar? I wouldn't. Why? Stealing is wrong. Sure, all "bad" things are excusable in certain situations, but I think we can agree that stealing a candy bar has to be the result of a simple disregard for law and/or moral values. Taking what is not yours without good reason is wrong. In other words, those who would commit crimes are fundamentally different from ordinary people, and common thieves are closer to murderers than to regular human beings.
If that's not convincing, how about this simple idea. How many people's lives would be ruined if that was the penalty for stealing a candy bar? Probably none, because no one would steal a candy bar if the punishment was that bad. If the punishment fits the crime, people are more willing to commit the crime. It's like opportunity cost in economics. When the US government raised safety requirements in cars, people in general started driving faster and pedestrian deaths increased. If the risks of an action, ie stealing a candy bar, are huge, then no one will take the risk. If every crime was punishable by death, only the stupidist or most insane would actually commit crimes.