I don't see how punishment is immoral: if as the first paragraph states it is in proportion to the damage of the crime. Not everything is monitary but say someone steals your wallet with $200 in it. If months later cops catch the criminal would it be unreasonable for them to take $200 from the criminals wallet and give it to you even if it isn't the same $200 they took? With emotional/physical damages it is harder to balance things out of course but neither of the alternative reasons are acceptable to me for a simple reason: changing moral norms/noisy governments/religions.
Deterrence: what if you do a crime with low impact but that the government decides is a politically great thing to be seen as cracking down on? Say gay sex a hundred years ago, or smoking pot. Getting the required level of deterrence might require a hugely disproportionate punishment on the few that you catch.
curative: social norms change and governments generally follow the lead of the masses/majority religion. So things that are otherwise not clearly harmful might be illegal for no other reason than because the government decides to run a christian/muslim/flying spaghetti monster society. What if your "crime" is a matter of personal choice and victimless? What if you don't want to be cured? When people are clearly mentally ill we might force them to be cured under the assumption that they aren't mentally able to understand the consequences of their refusing treatment (or the benefits of having treatment). But psychology is too easily controlled by societies definition of socially acceptable that you'll end up in the same situation: governments/religions will dictate what is "sane" behaviour. Example: people don't masturbate in public because it is seen as rude (and decades of religious indoctrination tells them sex is embarassing/immoral/private). But say someone wanted to have a wank on a bus, who was hurt? At worse it would be a health hazard if they don't clean up after themselves as people are quite capable of looking the other way when they don't want to see something if they chose to stare and get offended inside I'd argue that would be their problem not his.