The logic is about a battle of ideologies. When the villain, or the hero sometimes, says they'd be just as bad as what they're fighting, what they mean is that they're succumbing to their baser instincts, allowing "might makes right" to win out against the spirit of democracy. "Democracy" in their view, the author's I mean, is mostly about letting people coexist, and using only official channels to punish the most obscene offenders. The hero is rejecting "an eye for an eye," essentially, in favor of the perceived fairness of The Law.
This framing kind of doesn't work because we all know who the villains are. We all know the world would be better off without The Joker in it. And worse, letting him go through the prison system to get the outcome we all want for him anyway isn't really different from just shooting him yourself. It's marginally different, maybe; probably better than enabling a bunch of vigilantes. But even so, it is an action that merely defers the pulling of the trigger to the state. Someone will be pulling it regardless, because as we all know, the world would be better off without The Joker.
This framing about due process works a lot better with villains who are not The Joker because it leaves open the possibility that the law might not actually punish them, and that the vigilante hero is a bad person for trying to kill someone who does not actually deserve death.