1) Keep those likely to re-offend out of society. This is not only violent criminals but also career criminals - burglars, serial spousal abusers, etc.
2) Deterrent effect. The threat of prison definitely deters a lot of criminal activity. If you get really angry at someone, if you didn't have to worry about going to jail, you'd be a lot more likely to assault him. If you're a burglar, you'll be a lot more limited about the houses you break into if you know you'll go to jail if you get caught. If you're thinking about embezzling from your employer, you may refrain out of fear of punishment; if there were no consequences, you'd be a lot more likely to offend.
3) Righteous vengeance among the public. This is harder to justify but anger at wrongdoers is a normal human emotion - more normal, in my opinion, than universal forgiveness - and people need to feel that the law is fair and will protect us. That's a minor factor, of course.
The problem with the original poster's point of view is that he doesn't seem to recognize that there are assholes among us - sociopaths who don't care who they hurt and in some cases delight in taking advantage of other people. Those individuals are pretty much beyond my sympathy and if something terrible happens to them - like jail - it's well deserved.
That's not to say that we don't have a lot of people in prison who shouldn't be there, and we should rethink some of our policies - but I believe that part of the reason crime has decreased in certain areas is longer jail sentences for career criminals. The objective of our legal system should be primarily to protect the law-abiding members of our society.