The Catholic magisterium does not, and never has, advocated unqualified abolition of the death penalty. I know of no official statement from popes or bishops, whether in the past or in the present, that denies the right of the State to execute offenders at least in certain extreme cases. […] Catholic authorities justify the right of the State to inflict capital punishment on the ground that the State does not act on its own authority but as the agent of God, who is supreme lord of life and death. In so holding they can properly appeal to Scripture. Paul holds that the ruler is God’s minister in executing God’s wrath against the evildoer (Romans 13:4). Peter admonishes Christians to be subject to emperors and governors, who have been sent by God to punish those who do wrong (1 Peter 2:13). Jesus, as already noted, apparently recognized that Pilate’s authority over his life came from God (John 19:11).
Pius XII, in a further clarification of the standard argument, holds that when the State, acting by its ministerial power, uses the death penalty, it does not exercise dominion over human life but only recognizes that the criminal, by a kind of moral suicide, has deprived himself of the right to life. In the Pope’s words,
Even when there is question of the execution of a condemned man, the State does not dispose of the individual’s right to life. In this case it is reserved to the public power to deprive the condemned person of the enjoyment of life in expiation of his crime when, by his crime, he has already dispossessed himself of his right to life.
In light of all this it seems safe to conclude that the death penalty is not in itself a violation of the right to life. The real issue for Catholics is to determine the circumstances under which that penalty ought to be applied.
Avery Cardinal Dulles, “Catholicism & Capital Punishment” (2001)