Quote Originally Posted by A.Saturnus
General prevention - people are deterred from breaking the law by the fact that they would receive punishment.
Individual prevention - by punishing anti-social behavior a pro-social learning process should be induced in the offender
Exclusion - while locked up, offenders can't harm society any further
Order of Law - the authority of the law must be integrated part of society, so that it is part of culture that acts against the law have repercussion
All those purposes can be grouped in the first two. The third is exactly what you don't like (and I either for that matter) but some judges do: "retribution".