The Catechism of the Catholic Church should ideally provide some reference in each of its teachings to Scripture and Tradition.
The section on the death penalty (2267) doesn't do this.
So, in lieu of Catechism footnotes, let me direct interested parties to the First Things article by Avery Cardinal Dulles, Catholicism and Capital Punishment
I've always had a quibble with capital punishment, since it has never seemed to jibe well with Catholicism's reverence for natural law. But in reading Dulles' article, I see that the justification for the death penalty is not that it is consonant with natural law, but rather that it is not, properly speaking, the act of men.
God alone is judge and God alone is Lord of life and death. But there is a bridge between God's lordship and human action, and that bridge is Biblical doctrine. Civil authorities (no matter their personal creed or model of government) are bequeathed God's authority for the sake of maintaining public order. This is not the "divine right of kings"--it is rather an acknowledgement that earthly power, whether acknowledged or not, comes from God.
Entering into Catholic faith is sometimes a process of letting go of deeply rooted assumptions. Modern sympathies, my own included, are to regard civil authorities with quasi-contempt: hardly divine, scarcely sometimes even human.
Yet deference to civil authority is so deeply ingrained in Catholic tradition that it cannot be disposed of without heterodoxy. I just never imagined before that it would reach such a height as to elevate the State above the proscription against killing. But the more I understand Catholic faith, the more I begin to see how all of creation (not only nature but society) is shot through with the divine.
My soft heart is happy that the Holy See views the death penalty as scarcely ever justified in developed nations. But my intellect does grasp that civil authorities are regarded as no more artificial or disposable than the human family, and that each of these entities has certain powers and duties that transcend the individual, making them more than the sum of their parts.