Why don’t we just look at what the CCC says about the subject:2266 The State’s effort to contain the spread of behaviors injurious to human rights and the fundamental rules of civil coexistence corresponds to the requirement of watching over the common good…
2267 The traditional teaching of the Church does not exclude, presupposing full ascertainment of the identity and responsibility of the offender, recourse to the death penalty, when this is the only practicable way to defend the lives of human beings effectively against the aggressor.So the CCC clearly teaches that the death penalty is appropriate when it is the only practical way to defend society against the aggressor (this is as opposed to your statement talking about when lifelong imprisonment is possible).
I rather like St Thomas Aquinas’ way of thinking about the subject ( II-II-64-2S. Th.)I answer that, As stated above (Article 1), it is lawful to kill dumb animals, in so far as they are naturally directed to man’s use, as the imperfect is directed to the perfect. Now every part is directed to the whole, as imperfect to perfect, wherefore every part is naturally for the sake of the whole. For this reason we observe that if the health of the whole body demands the excision of a member, through its being decayed or infectious to the other members, it will be both praiseworthy and advantageous to have it cut away. Now every individual person is compared to the whole community, as part to whole. Therefore if a man be dangerous and infectious to the community, on account of some sin, it is praiseworthy and advantageous that he be killed in order to safeguard the common good, since “a little leaven corrupteth the whole lump” (1 Corinthians 5:6). Also pay particular attention to his answer to objection 2:According to the order of His wisdom, God sometimes slays sinners forthwith in order to deliver the good, whereas sometimes He allows them time to repent, according as He knows what is expedient for His elect. This also does human justice imitate according to its powers; for it puts to death those who are dangerous to others, while it allows time for repentance to those who sin without grievously harming others.And you see the way that St Thomas handled it is that he talked about the necessity to excise the infected member before it had a chance to do more damage to the whole body.
Both the CCC and St Thomas are basically saying the same thing. You don’t amputate limbs at the first whim, but only when it is necessary to prevent gangrene from spreading.
Popes, particularly the last three, have spoken out against the death penalty, believing it to be unnecessary in most cases. Again, that makes sense: we have wound vacuums and antibiotics now: amputating limbs is far less common these days than before. We should be smart enough to avoid having to “amputate” members from the “body” of mankind in most cases, as well.
As a point of interest, though, back in 1568, Pope Pius V published an Apostolic Constitution, Horrendum Illud Scelus, where he prescribed that priests who engaged in homosexual activity should be stripped of all title and privilege and immediately turned over to the secular authorities, who should put them to death.
I find it utterly ironic that the EU requires countries to abolish the death penalty for the guilty but yet has no problem, and in fact, pushes member countries, to inflict the death penalty on society’s most innocent members. An extra-judicial death penalty with no accusation, no evidence, no conviction, and no appeal.