For anybody else like me that wasn't aware of the source for the opening post:
It's Numbers 31:17
http://www.biblegateway.com/passage/?book_id=4&chapter=29&version=31
The targeted group is the Midianites. They seem to be a group that Moses and the Israelis fleeing Egypt came across in the desert. Apparently they had been bad to the Israelis and the Moses wanted his armies to seek vengeance. Initially his army just killed all the adult men, but God as per Moses thought this wasn't sufficient and that all the boys and non-virgin women should be killed also.
Actually, the way I had understood it, the Midianites had been in fact pretty nice and hospitable to Moses's men.
So some of the hebrews took wives from Midian, and some of those moved to Midian and converted to their wives' religion.
So the good Lord gave a plague. Of course, not to the hebrews who had converted, not even to the Midianites, but to the still faithful hebrews. You know, because apparently that's his idea of justice. Why bother punishing the guilty, when smiting a few of your own minions vents frustration just as well?
(Real Evil Overlord material there. And not the kind that's read the Evil Overlord's List.)
So first the plague is lifted because some dude takes a spear and kills a man and his wife in their own home. Apparently just because the victim was the last guy to marry a midianite woman.
Note: nowhere is it mentioned that he also gave up his religion or anything. In fact, since he came back with her to Moses's theocratic flock, it's probably safe to assume that she converted to Judaism instead.
Anyway, no trial, no chance to defend oneself in court, no proper stoning. Remember that the whole stoning deal was because of the "thou shalt not kill" part. So they used stoning so, because no individual stone was lethal, no individual guy who had thrown a stone was guilty of killing anyone. (Gotta love that kind of logic

)
But this time, you know, a guy just takes a spear and kills a couple in their own home. Common premeditated murder at its finest. Exactly what the Lord had forbidden.
So _obviously_ the Lord is pleased and lifts the plague.
But the Midianites were still guilty of the grievous crime of, you know, being nice to the hebrews and marrying their daughters to the hebrews. And for that the Lord orders the complete genocide of the Midianites.
I don't know, man... the Bible has much morally objectionable stuff, but this for me takes the crown.