Justice as prevention is secondary - and arguably ineffective - or we'd have no crime, no recidivism, no addicts, nobody acting with obviously negative personal outcomes.
I guess there are some edge cases. Drug smugglers for example are probably aware of the rough probability of detection and weigh it up against the length of jail time. But I reckon Sarkozy thought he'd just get away with it and didn't even consider what the potential punishment would be.
It's worth considering then that the next person who has the option to do this might behave differently, given Sarkozy has not got away with it.
To use the example from a sibling comment, if a person kills a child and the father kills this guy out of vengeance .. it will do those children good, who can now live in safety afterwards from that person.
But if in reality the murderer also had family who did not believe he murdered anyone in the first place now set out to seek justice/vengeance, then yes, it becomes a war .. which is why we have courts and police nowdays, but what justice is, is still rather arbitarily defined. Concretely it means enforcing the law. And laws are written by people.
For a modern look at this, look at the xeer system of Somalia, where victims will almost always prefer payment/compensation over punishment.
Imprisonment is largely an invention of the state, as they push victims and inter-personal conflict aside, and rather use their tools to subordinate the citizen to the order of the state and then charge the victim taxpayers the cost of imprisonment and funnel the money into their buddies running and working the prisons.
You're implying that imprisonment makes people offend more - perhaps the simpler explanation is that most criminals will commit crimes when they get the chance, especially prolific criminals. Prison takes them off the streets and stops them victimising more people - this is helpful.
* An honest acknowledgement of ones behaviour and its impact on others.
* Accepting the consequences of your behaviour, whether legal (such as going to jail), financial, or personal.
* Taking the initiative to make amends where possible.
* Taking steps to improve oneself and/or prevent the same behaviour in future.
For a nuanced discussion, the Illustrated Guide to the Law is an excellent introduction. Here's the section on Punishment: https://lawcomic.net/guide/?p=41
It ends with the summary "The State punishes those who commit crimes partly in the hope of preventing future offenses (via rehabilitation, deterrence, and removal)... partly to restore a sense of balance and fairness (via retribution)... and partly because fuck you, that’s why (retaliation)"
The reason the answer is not clear is attitudes to Retributive Justice vary widely across cultures and political systems. In OECD countries, the dominant (but not universal view) is there is no role for Retributive Justice in a modern society.
That is my position. The reason I don't think vengeance should be part of Justice is it's counter productive. The role of society as I see it, is to create an environment that produces nice things for myself and my family, so we prosper. I think it's self evident having as many people as possible working hard maximises this.
Justice is a unfortunate blight on that. Producing nice things requires people to work cooperatively, people working cooperatively requires rules. You can't have someone kill another for food when they could be working on a farm instead, so we have a rule for that. The role of Justice is to encourage people to follow those rules, so Justice is necessary too. But Justice is costly. It requires police, lawyers, judges, and jails. It removes people who could be producing nice things from society and makes them a burden to carry instead. "An eye for an eye" sounds equitable, but it means there are now two people without an eye instead of one. There have been calculations on what the Justice systems costs a typical OECD country. The answer seems to be around 2% of GDP. For the USA, that's about $600 billion per year.
Because of that large cost to me it is self evident you want as little Justice as possible. Just enough so just about everyone follows the rules, and no more. If you are forced to productive people from society and feed, house, and protect them in a jail, then you should strive to redirect, educate, and train them so when released they will become productive, and produce nice things. For me. This is called rehabilitation. Every modern society preaches rehabilitation over vengeance, but not all do it.
So what rule does vengeance play in this? Vengeance is by definition punishing people more than rehabilitation requires. Thus it costs money to extract vengeance. Sometimes a lot of money. In my country jailing someone for life means it costs my government $300/day, potentially for decades. That means I have less nice things. It even means the victim has less nice things, in the end. After all, that money could be paying for teachers and schools, to educate the victims kids. The conclusion most most people in OECD societies have drawn from that is vengeance has no role in Justice.
In this view, the becoming the victim of a crime is no different to any another unfortunate event, like losing your house to a storm, or becoming the victim of a plane crash, or dying from cancer. You don't get to seek vengeance for those events, so why should being the victim of a crime be any different? Adding to that, you are not entirely powerless against random destructive events. You can insure against them. Crime is no different. We can and do insure against the ill effects of crime.