The Catholic Church has always held that there is a prudential judgement involved on the issue of the death penalty and how it is applied. The state has a right to impose the death penalty for certain crimes, again, this involves prudential judgement. When Christ sent out his apostles out and when they had to cross bandit territory he instructed them to have with them a sword and it was not for chopping carrots.
There is always a place for the death penalty to be applied in accordance with the prudential judgement of the state. Of course, we do not want summary execution by a mob, but sometimes there are evil people and some of them are heinous that righteous and just men may exact their own justice.
When you say
you commit the fallacy called presentism. Human history occurs within a milieu. Cattle rustling was a hanging crime, today it is not. You are applying the rules of today to sometime in the past. You are attempting to judge behavior by today’s standards.
So for example a foreign national say from Somalia commits kills three people. I would not think twice about sentencing the person to death. However, if it was an American citizen or a Spanish citizen I would leave that to the prudential judgement of those concerned. The reason is simple, Somalia refuses to take its citizens back. So we do not want the person running around a country he is a visitor in so execute him. But this again is an exercise of prudential judgement.
While recent popes have expressed opinions that alternatives to the death penalty are preferable, it would be doctrinally unsound if they should declare that the death penalty is morally evil, it is not.