A propos of nothing, I was thinking today about a comparison I've frequently seen made between the death penalty and war --- viz., that if you believe killing in war is sometimes justified, then you cannot be philosophically consistent and also categorically oppose capital punishment. I find this comparison rather fatuous. Under conditions of war, there is no reasonable way to accomplish your goals --- like stopping the Axis powers from taking over the world ---- except by killing large numbers of people. If you try to stop the Axis powers from taking over the world, many of their people will shoot at you, and will not stop shooting at you until they are dead. And the goal, in this case, is unquestionably good: if the Axis powers take over the world, then a lot of people will die or suffer horrific oppression.
Capital punishment is a completely different beast. At the point where capital punishment comes into play, the person to be executed is sitting inside a steel-barred concrete cell. However horrific we find this person's psyche, (s)he is essentially a helpless worm in the unyielding grasp of the state's fist. Now, consider what further objectives society has, and whether these objectives can be accomplished by nonlethal means. I'd claim the only unquestionably good aim here is to defend society against future violence, which can be accomplished by keeping that person in the cell forever. There's an array of other, far more questionable objectives, like vengeance or emotional satisfaction, that may require you to execute this person, but it's hardly inconsistent to believe that such objectives do not justify killing.
Or, to put it another way, justifiable killing requires that the aim be just, and that there be no other way to accomplish that aim. One can therefore consistently believe that for a modern nation-state, killing in war is justified, but capital punishment is not.
Incidentally, note that the above implies that if a nation can attain its war aims without killing people, it is obligated to do so. It also implies that if the governing power is too insecure and weak to guarantee incarceration for a complete human lifetime, then it may be justified in killing instead. The latter's interesting for two reasons. First, it probably describes the conditions under which Old Testament moral codes were crafted. Second, if you believe, as I do, that we may enter a future phase of history when human lifespans exceed those of nation-states, then capital punishment may be justified again.