After the war with מדין, Moshe Rabbeinu is upset that Midianite women were brought back as captives. Moshe felt that these women, who enticed Jewish men to sin, were deserving of death. After all, the whole reason for taking vengeance on Midian, was because of these sinful women.
Moshe then instructed that all the women who transgressed with Jewish men, should actually be put to death.
On the surface, this whole incident seems troubling. How could the killing of defenseless women, be justified? Yet, it is written that when evil is destroyed, it is, in actuality, a merciful act.
The perpetrator of evil, when eliminated, makes the world a holier and safer place. It is horrible that it is possible for man to choose evil, and degrade himself to such a low level.
But it is more important to follow the instructions of Moshe Rabbeinu and destroy evil, thereby making the world a better place. This is real mercy and compassion.