One relatively common principle in most modern justice systems (and oftentimes not even so modern, since the principle has probably been around for quite some time) is that for many/most crimes first-time offenders get a lighter sentence than repeat offenders.
The idea behind this is, essentially, to give people a second chance, to learn their lesson and to become better. People are young and inexperienced, they act foolishly and without thinking, they act impulsively, they don't fully realize the consequences of their actions, they may be a bit arrogant and full of themselves and do things that they shouldn't really be doing. Getting caught and going through that legal process, essentially and hopefully, "scares them straight".
Being caught and tried for a crime, with all the police investigation, lawyers and all that stuff, and especially the prospect of being possibly found guilty and fined or even put into jail, can be really stressing for someone who has never had to deal with that kind of situation. This process can indeed be a huge wake-up call. "Hey, you, stop acting foolishly. You are not the king of the world; your actions have real consequences, you can't do whatever you please. You have to be more mindful and more careful with your actions, or you'll be seriously screwed. Your life could be ruined."
Many, if not most, first-time offenders do indeed learn their lesson. The whole process is indeed so scary and effective that they are "scared straight". Most of these people do become model citizens and never repeat their crimes.
Quite many people, however, disagree with the notion of giving lighter sentences to first-time offenders. "F**k them, they shouldn't have done it. They were perfectly aware of it before doing it." This sentiment is especially aggravated by the few cases that always happen when some criminal does not learn their lesson and immediately go and do it again. It can be really aggravated if the crime is something like rape. Thus they think that all rapists, and all other like criminals, should be given full sentences from the get-go. No leniency.
I have to strongly disagree with that sentiment. Do we really have to punish the majority for the crimes of the minority? Is it really fair for all those people who simply acted foolishly and without thinking, and who would truly learn their lesson from a lighter sentence and become model citizens, if they were instead punished with the longest possible sentences because of those few people who do not learn the lesson?
We should strive to be a civilized, humane society. Rehabilitation is more important than punishment. We should not punish harshly those who would fully rehabilitate from a light sentence just because a few bad apples don't. We should be more empathetic and less cynical. Sure it sucks when one of the bad apples repeats a serious crime, but the solution to that problem is not to punish everybody "just in case".
(And if you are thinking that I'm writing this because I have perpetrated some crime or gone through that process, that's not the case. I have never done anything nor gone through that, thankfully. However, I do sympathize with people who do. I can feel empathy, as a fellow human being. Personally if I were to act so foolishly and be investigated, I would certainly be scared shitless.)