We read in the Catechism of the Catholic Church (paragraph 2267) that
"Assuming that the guilty party's identity and responsibility have been fully determined, the traditional teaching of the Church does not exclude recourse to the death penalty, if this is the only possible way of effectively defending human lives against the unjust aggressor.If, however, non-lethal means are sufficient to defend and protect people's safety from the aggressor, authority will limit itself to such means, as these are more in keeping with the concrete conditions of the common good and are more in conformity to the dignity of the human person.
Today, in fact, as a consequence of the possibilities which the state has for effectively preventing crime, by rendering one who has committed an offense incapable of doing harm - without definitely taking away from him the possibility of redeeming himself - the cases in which the execution of the offender is an absolute necessity 'are very rare, if not practically non-existent.'"
We find therefore, that there is a context in which the death penalty is a permissible--and arguably even necessary--evil for society. This context is that if innocent people will be harmed (e.g. raped or murdered) by not executing the criminal, then it becomes the duty of the state to bring about his execution to protect its innocent citizens. With this in mind, the debate over the death penalty is whether or not this or that particular criminal poses such a threat.
Can he be safely kept in (solitary) confinement, or is he the type of mastermind who will escape from any prison and then use his freedom to harm another victim? Is executing this or that criminal actually necessary to protect innocent lives, or is it a matter of convenience, of revenge, or of a misguided mercy which places capital punishment on the same footing as euthanasia? These are questions which we should be asking in each particular case in which the death penalty is considered: and in many such cases, the answer is is at best a sense of justice untempered by mercy; or (to hear some motives), it is mercy unhindered by justice.
The justest end of the death penalty must ultimately be the protection of the innocent, and not rather the killing of the guilty. The attitude here should be the regret-filled "In order to protect the lives of the innocent, we are forced to kill this guilty man," and not the more gleeful-sounding "Since he may remain a threat even while imprisoned, we get to kill this criminal." Unfortunately, I do not think that the former is always at the foremost of the would-be executioners' minds; it would certainly take a heroic effort on the part of the family and friends among the most violent criminal's victims to not hold as a motive the latter.