A murderer, rapist, or terrorist can be taught the wrongs of their ways then corrected and released back into the world as a contributing member of society. Also, a compromised punishment for such crimes post-release is already established such as the barring of privilege to vote. Moreover, the guilt that plagues them until they either die or forgive themselves is more than enough to act as punishment.
Lastly, I want you to think about these specific example and provide me a reasonable answer as to why they really should be hanged.
1. A person committed a first degree murder by killing a man who turned out to have been abusing said person and possibly others.
2. A person while drunk and thus unable to act in a reasonable manner commits sexual assault on another.
3. A person who was raised under the need to achieve some fanatical ideal and ignorant of other ways of thinking performs an act of terrorism.
In all three cases, rehab can right their wrong paths.
It has been historically proven that removing the humanity within a group of people will always lead to the end of equality (eg. slavery, Trail of Tears, Holocaust).