To be fair, though, some moral frameworks (not mine) proscribe that any killing is bad, even to save oneself or others.
I don't mean this as a "gotcha", but as a reminder that morality is a human invention, and different humans will take different moral stances on things.
If a police sniper shoots a mass shooter in the middle of their mass shooting, that's a hero. Not a villain.