Very briefly, here is a summary of the various theories behind criminal justice.
There are several main theories underlying the justifications for a system of criminal justice. They are as follows:
Retribution: This is based on the notion that a criminal "deserves" to be punished for the crime he commits.
Deterrence: This is based on the notion that we want to discourage people from committing crimes again in the future. There are two types -- "general deterrence" and "specific deterrence". General deterrence means you are trying to discourage the population at large from committing crimes. Specific deterrence means you are trying to discourage the offender you're locking up from committing another crime in the future.
Incapacitation: This is based on the notion that we want to lock people up to physically prevent them from committing another crime. You just want to remove them from the public areana, to keep them from being a danger to others.
Rehabilitation: This says that we want to use imprisonment to reform prisoners (and is not exclusive to the above theories, it really has more to do with what we do with the prisoners once we have them in prison).
The last three theories are known as "utilitarian" theories because they are based on the idea that we are imprisoning people in order to increase social utility (here, utility is gained in the form of decreasing crime). These sorts of theories were advocated by Jeremey Bentham and John Stuart Mill.
The retribution theory (advocated by Immanuel Kant) is sometimes called "deontology" or "a deontological theory". Don't get thrown by the fancy name. It's based on the notion that there is a duty or imperative to act morally, and that people who violate this duty must receive their "just desserts", and so on.
Now, what you need to understand is that what theory you adopt affects the question of how you should deal with a criminal.
For example, suppose I believe solely in deterrence. Then I would punish someone only in order to prevent further crimes. If it was possible to discourage people from committing murders merely by fining them $100, that would be enough. To do any more than that would be needlessly inflicting suffering on the criminal.
Conversely, a person who believes in retribution is more likely to want to give the murderer the death penalty because they "deserve" to be punish in proportion to the crime they've committed.
You don't like the first situation as much because you see it as "too easy" on the criminal. But this is not necessarily the case. Suppose that the only way you could discourage people from committing petty theft is by sentencing them to life in prison. Then a pure deterrence theory person would say that's exactly what you should do. On the other hand, a retribution theory person would probably say that a petty thief does not "deserve" life in prison merely for petty theft.
Those are a couple of extreme examples that make retribution look more sensible than deterrence, but you can imagine less extreme examples if you like.
Another situation where the theories differ is in the case of the retarded person, as I demonstrated above. If you believe solely in retribution, you would NOT lock up the retarded person for committing murder, because it isn't their fault they are retarded and they don't "deserve" to be locked up.
A person who believes only in specific deterrence probably wouldn't lock up the retarded person either, because the person is unlikely to respond rationally in the future, and hence unlikely to be deterred. In other words, if the retarded person is "too dumb" to understand that committing another crime will get them locked up again, it doesn't make any sense to lock them up in the first place.
On the other hand, a person who believes in incapacitation believes that it is necessary to lock the person up in order to protect society. (But you would still try to house the person humanely, because to treat them harshly would be to inflict needless suffering.)
A person who believes in general deterrence may or may not lock up the retarded person, depending on how they think society at large will respond. If society at large understands that we're only going to make a special exception for retarded people, but that anyone else will still get locked up for committing crimes, then you wouldn't lock up the retarded person.
Do you see how the theories operate differently in different situations? Note that depending on the situation, one theory may seem intuitively more sensible than another. Sometimes your "gut feeling" tells you that retribution makes more sense (as in the case of not wanting to sentence someone to life in prison for petty theft). But in other situations, like the retarded person, incapacitation seems to make more sense intuitively.