It is justified all the time by different lines of logic and rational. What I think is being asked is whether there is a fundamental flaw with a justice system that forbids the removal of life from another human being, doing so in its own manner for the proposed greater good.
Obviously it can be argued both ways.
On one extreme brutal punishment would keep our prisons much more empty and our tax dollars otherwise spent. Sure people would be missing hands because they stole, genitals because they raped, and heads because they killed someone in cold blood but it is economical to administer one dose of punishment, instead of a slow one over time.
We have a moderated view of this and have decided to take on the difficult task of deciding what crime deserves what punishment. Is the crime heinous enough to warrant execution? How long will it take for the execution to be conducted? How many appeals is a person allowed? What rights do prisoner's have? What compensation should be given to those wrongfully convicted or the families of those wrongfully executed?
This is a hybrid that states that there are instances where a crime is so utterly despicable that it is necessary for an entity to be purged from society. The act of capital punishment is viewed then as both cathartic, and cleansing.
The final viewpoint and other extreme states that as human beings we are graced with greater powers of intellect and emotion thereby allowing us to rise above the desire to claim the fickle intoxicant; revenge. This is modulated by the well known fact that humans are a pretentious creature, thinking a great deal of itself and its creations. That aside, there are the arguable instances where executions do not deter murder, where 'killing to sanction killing' is a fallacy, and where there are some regions of powers that a government entities should not be treading.
All three have justifications, logic, and rational. All three have these in different forms.
I am not sold on any, and won't be any time soon.
Cheers