Killing an attacker in self-defense is one thing, but once he is apprehended applying the death penalty is completely irrational. It doesn't serve as an effective deterrent, while being forced to work for the rest of your miserable life to pay restitution (to victims' families / inheritors or appropriate charities) is more likely to make you think twice. The death penalty brings out the public pity and emotion for all the wrong reasons, and some pieces of shit might actually want the attention, so it would only encourage them. It actually costs more money to put someone to death, even without prison labor, because of all the extra legal costs 'n stuff. Plus death is so final and irreversible, while no justice system is 100% infallible.
Plus hanging is a pretty painful way to kill someone, especially a Jap - they tend to be lighter and have stronger necks for some reason, so death takes longer.