Rehabilitation is only one of the criteria for taking away someone's liberty (or life, if rehabilitation is ruled out as a possibility). The others are:
Deterrence - If you kill, you lose your life, just like when you walk off a 10th story balcony. The laws of physics are absolute and self-enforcing. Criminal laws lag woefully behind. Why not kill someone you hate as a minor, if you know you're getting off light? Few people are deterred by religious beliefs these days.
Retribution - If the justice system doesn't deliver proportional justice, parents, brothers or sons will. Endless vendettas are not good for anybody.
Protection of society - Dangerous animals shouldn't be roaming the streets, even if they look like human beings. They need to be caged or put to sleep.