Some criminals should be punished to remove their incentive for committing crimes. But there are some criminals who just need to be removed from society to prevent them from preying upon society.
Obviously for lesser crimes, lesser punishments should be delivered. AND punishments (if at all possible) should reflect the crime committed --- such as scrubbing walls for "graffiti artists", picking up trash for litterers, etc. Not enough of this is done.
Punishments should not punish society if alternatives are available. Jailing everyone (as is now practiced extensively in the U.S.A.) also punishes society --- tax money is used.
Whippings and public service are excellent punishments and (at least whippings) are not practiced in the U.S.A. But where they are practiced, crime is lower. These forms of punishment also do not cost the taxpayers a lot of money.
For most criminals, the threat of "adequate" punishment will deter them. "Adequate" does not include sitting on one's bum all day with free meals and a warm place to sleep --- not to mention watching television and playing video games (or whatever else jails provide these days).
But then, on the other side of this argument is the fact that far too many people are made criminals for things which should not be a crime. I once heard of a woman being jailed for overdue library books --- beyond absurd. And, at least in one municipality, they wanted to make jaywalking a jailable offence --- again way beyond absurd.
REAL criminals belong in the jails --- not jaywalkers, people who get into fights, marijuana smokers, etc.