There are moral differences between abortion and the death penalty. Abortion is a direct action that takes an innocent human life. The death penalty is the self-defense of society against an unjust aggressor.
Let us look at how the Catechism describes the death penalty:
**2263 **The legitimate defense of persons and societies is not an exception to the prohibition against the murder of the innocent that constitutes intentional killing. “The act of self-defense can have a double effect: the preservation of one’s own life; and the killing of the aggressor. . . . The one is intended, the other is not.”
**2267 **…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…
Notice how the death penalty falls under self defense. The same as you would have the right to defend your life or the lives of your loved ones with lethal means
if necessary so too does society through its legitimate representatives.
The Church describes abortion quite differently:
**2270 **Human life must be respected and protected absolutely from the moment of conception. From the first moment of his existence, a human being must be recognized as having the rights of a person - among which is the inviolable right of every innocent being to life.
**2274 **Since it must be treated from conception as a person, the embryo must be defended in its integrity, cared for, and healed, as far as possible, like any other human being…
Unlike the death penalty abortion has no other intention than the taking of a human life, and also an innocent one. Abortion falls under the same moral principal that forbids the intended killing of innocent persons under all circumstances.
You are mostly correct that the difference between the two is found in the innocence or guilt of the individual but it also lies in the intention of the action. One action (death penalty) intends to protect society, the other action (abortion) intends the taking of human life.
However, just because someone is guilty does not mean society is free to execute them. Capital Punishment is moral in particular circumstances not all circumstances. Society must be morally certain the individual is guilty of a grave crime **and **have no other legitimate means of protecting itself. Whether or not there are non-lethal means to protect society is a prudential judgment and people of good will could have differing views.
Thus the death penalty, by its very nature, can never be completely “non-negotiable” in the same way that we could never say someone would never have to resort to killing in order to protect oneself or others. We can certainly debate appropriate circumstances to take such action and the means to prevent us from getting that far, but it can never really be taken off the table since it is not intrinsically wrong (unlike abortion).