"Make people not do bad things" is a golden goose. Nobody has yet come up with a way to make that actually happen.
I don't know whether you speak out of ignorance, stupidity, contrariness or misplaced belief, but the above is a big fucking lie.
There are lots of programmes that makes people not do bad things. They're called preventative measures, and includes programmes like free methadon for heroin addicts, poverty reduction, incentives to hire ex-cons, psychological and psychiatric assistance programmes, and much more. And they do work - crime rates and recidivism goes down.
If you look at things in black and white and think that if it doesn't stop 100% of the crime it's ineffective, you refuse to see the big picture. It doesn't have to. If leads to a measurable improvement, it does reduce the number of crimes committed and suffering victims.
If that isn't your goal, you're part of the problem, not the solution.
While you're sitting dreaming of ways to stop people from doing bad things would you rather there were no penalty for crime, or have I myself now misrepresented your views?
Can you even help yourself from doing that?
Prison sentences serve multiple purposes:
Studies show that the length and severity of the sentence is only effective up to a certain point. No one will abstain from doing a crime because they risk 40 years in jail instead of 12. In some cases, too harsh mandatory or customary sentencing has a detrimental effect. A good example is child molestation, where the super-long sentencing causes children to not report their parents, because they don't want to see people they love go to jail for the rest of their lives. They endure instead, and become more traumatized. Another example is capital punishment. When that is in place, it is in the interest of a criminal to kill witnesses and police, because it won't make the sentencing any harder, but will make it more likely they get away with it.
Yes, deterrence works. Up to a point. Based on that factor, the sentencing here in the US is far too long for the maximal effect.
While in prison, the opportunity to commit the same crime as arrested for is low. This has an effect when the recidivism risk is high. But the way it is used in the US is not based on statistics, but on fucking feelings. The crimes with the highest recidivism rates get shorter sentencing than the ones with lower recidivism rates. So it's obviously not a main concern. Many other countries split the sentencing between the actual punishment and an additional detainment, which is meant to be for preventative reasons. A few even factor in the risk of recidivism.
It is in society's best interest that a convicted criminal returns to society as a productive member; the sooner, the better. Most Western countries try to use the time criminals spend incarcerated in preparing them for returning to a normal life, not to "reward" the criminal, but because it greatly reduces recidivism and costs to everyone. In the US, there's pretty much no rehabilitation, and the number of ex-convicts who return to crime is astonishingly high compared to the rest of the world.
It doesn't undo the crime, and drags those exacting revenge down to the same level as the criminal. It certainly doesn't make the criminal any more inclined to become a happy member of society. Few countries now support this, and almost all that do, do it for religious reasons.
Yes, sentencing is necessary when someone is caught for a crime. But the sentencing needs to be rational, and not based on feelings. And better yet is to reduce the number of people sentenced by reducing the risk of crime before it happens. I know, alien concept, and you won't get your righteous rocks off as much by reading about caught perps.