While God does not change, and the gospel does not change, our understanding of both does over time change. With prayer and reflection our understanding develops and deepens.
People in defense of the death penalty will often quote today's first reading, "If anyone sheds the blood of man,by man shall his blood be shed."
This was for a primitive world in which the technology we had today did not exist. Pope John Paul II would go to an earlier story in Genesis as the foundation of our understanding. When Cain killed Abel, his own brother God forbid anyone to take his life, "If anyone kills Cain, Cain shall be avenged sevenfold." So the LORD put a mark on Cain, lest anyone should kill him at sight."
It is a reminder to us once more how simply playing pick a bible verse is not the best way to arrive at a true understanding of the Gospel. So how do we reconcile the conflicting texts on the death penalty.
The Catechism summarizes the argument this way.
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 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 nonexistent."