It's a fine line.
To me personally, what it boils down to is whether or not it was the right thing to do as well as necessary (to stop looters, for example), or if it being necessary doesn't mean it was right.
" After the war, a story developed which had it that Cornwallis ordered his own artillery to fire into the melee, despite being warned he would kill some of his own men. Recent research has proven this story completely apocryphal. The artillery did fire into the group, but only after American cavalry had entered the fray and threatened the British guns."
If Cornwalls had ordered his own artillery to fire into the melee without the American cavalry being involved like that, there are times it would be "unpleasant but necessary" (I'm not familiar enough with the battle to know if it would have been one).
By contrast, shooting looters at the sack of Kharangia? Better deaths than they deserve one could argue, but that doesn't mean I think killing people is pleasant.