This is a topic which nearly every private detective mystery writer has to at least brush by, so many of them choose to turn and address it directly with varying degrees of meta. I saved a couple of examples, though, as interesting or representative:
‘Wäre es nicht besser –’
‘That the murderer should remain undiscovered? On the face of it, yes. But none of us has the right to assess the value of a human existence. All must be held valuable, or none. The death of Christ and the death of Socrates,’ Fen added dryly, ‘suggest that our judgements are scarcely infallible . . . And the evil of Nazism lay precisely in this, that a group of men began to differentiate between the value of their fellow-beings, and to act on their conclusions. It isn’t a habit which I, for one, would like to encourage.’
Karl was silent for some moments before replying. ‘Veilleicht haben Sie recht,’ he said at last. ‘But I am glad he is dead.’ His voice sank to a whisper. ‘I am glad this man is dead.’
— Edmund Crispin, Swan Song
Roger laughed lightly. ‘Oh, I know it’s the right thing to say, “Who am I to take the responsibility of judging you? No, it is not for me to do so. I will hand you over to the police, which means that you will inevitably be hanged. It’s a pity, because my personal opinion is that your case is not murder, but justifiable homicide; and I know that a jury, directed by a judge with his eye on the asinine side of the law, would never be allowed to take that view. That’s why I so much regret having myself to place a halter round your neck by handing you over to the police. But how is such a one as me to judge you?” That’s what they always say in storybooks, isn’t it? But don’t you worry, Alec. I’m not a spineless nincompoop like that, and I’m not in the least afraid of taking the responsibility of judging a case on its own merits; in fact, I consider that I’m very much more competent to do so than are twelve thick-headed rustics, presided over by a somnolent and tortuous-minded gentleman in an out-of-date wig. No, I’m going to follow this up to the bitter end, and when I’ve got there I’ll take counsel with you as to what we’re going to do about it.’
— Anthony Berkeley, The Layton Court Mystery
‘Tell me, Ridley: do you think that if a thoroughly objectionable person is murdered, the murderer deserves to get away with it?’
The porter considered. ‘I don’t think so, sir, no. There’s other ways of dealing with objectionable persons than by murder.’
— Edmund Crispin, The Case of the Gilded Fly