How capital punishment is beneficial
A life for a life is just punishment for a person who cruelly and shamelessly lives at the cost of another’s life. Political morality is to punish a person by a death sentence in order to save a cruel person from going to hell. That a murderer is condemned to a death sentence by the state is good for the culprit because in his next life he will not have to suffer for his act of murder. Such a death sentence for the murderer is the lowest possible punishment offered to him, and it is said in the smriti-shastras that men who are punished by the king on the principle of a life for a life are purified of all their sins, so much so that they may be eligible for being promoted to the planets of heaven.
Srimad Bhagavatam 1.7.37 purport