I’ve said this a few places now, but I’m pretty sure everyone has situations where they believe killing someone is justified. It could be the death penalty, or removing a dictator, self defence, whatever. And everyone will have some they think are wrong that others don’t. I’d obviously want to avoid it as often as possible, and in instances where there is another viable alternative I’d prefer that to be taken, but there are plenty of situations where unfortunately there is no other method. I think relying on any rigid set of rules to definitively say something is wrong or right in all contexts is flawed. Laws shouldn’t be some ultimate measure of morality, and things that should generally be unacceptable can still have exceptions, because nothing exists in a vacuum and the judgement of an action can’t be done without understanding that context.
don’t forget mercy, there was a guy in sweden who killed his wife (i believe he shot her?) after she had explicitly asked for it verbally and in text for a long time, and the court took that in mind and lessened his verdict from murder to manslaughter or whatever the correct terms are.