This is where the antihero comes in. Someone pretty much on the side of good but who has some pretty unheroic approaches or behaviors, such as killing.
You may think those killings are justified, do less harm than good, are a net good, or whatever, but they’re not cleanly heroic, because that’s not how we should want problems solved or problematic people dealt with.
We as readers can follow the story and often have enough information that we could decide this or that was justified or not, we are given all the information the author wants us to know to make it feel justified or not, but the person meting out justice in these situations is not so omniscient. They could be mistaken, they can get things wrong, they can create a narrative in their head and then only see the evidence that supports that narrative while discarding the rest. Often enough this doesn’t happen in fiction, because authors don’t want us to feel discomfort at the means, but vindication at the villain getting ‘justice’. And maybe they are. But if you put a real person in that situation and give them the same leeway, the slippery slope is very much worth paying attention to.
The common trope of killing your way through a bunch of faceless mooks only to realize that if you kill the one making the decisions for them, you would be just as bad as them, is dumb because of the internal dissonance, not because of the idea that killing people is always bad.
Some people do, really, viscerally, believe that killing people IS always wrong. That it IS always evil. No matter who the person is or what they have done. This, I think, is a sentiment worth analyzing on its own merits, and worth separating from whether a vigilante performing it is itself worse than separating the chain of investigating, catching, judging, and executing to different parties, because if you don’t believe in the end result in any situation, then the steps in between are just an excuse that muddies the waters.
In any society worth saving, the separation of roles (investigate/capture/adjudicate/punish) is a moral technology that reduces error and abuse. Vigilantes short-circuit that technology.
Of course, many vigilante stories exist with the premise that this perfect system of neutral justice has already failed and will never deliver justice in the particular case the story is covering without the vigilante’s actions.
That all said, in worlds where (a) guilt is certain, (b) nonlethal containment reliably fails, and (c) the threat is catastrophic, refusing to kill can be a dereliction, not a virtue. To say nothing of situations of active defense from lethal intent to oneself or others.