You have to punish the defectors if you want to have a stable society. If you set up a law that says "X is punishable by death" and someone does X, then you have to deliver death to that person, or else the law loses all its coordinating power. If the law itself is not just, then you're responsible for unnecessary deaths, but a person committing X in full knowledge of the consequences is responsible for their own death.
It's really similar to jumping out of the 10th floor window. It's the dv/dt that actually kills you, but it's you who is responsible for your own death.
Your "need" to kill them because they crossed some line is your need, and you're the killer. (For better or worse...)