The Medrash on this week's Parsha says that Pinchas drove his spear straight through their genitals of Zimri and Kuzbi the Midyanite, as they were sinning together. Then, G-d gave Pinchas divine strength and he was able to lift both of their their dead bodies up out of the tent, while still on the spear, for all to see that they had been killed for their sins.
The Holy Ohr Hachaim Hakodesh, whose Yartzeit is tonight, writes that through doing this, Pinchas made the sin of illicit sexual relations look disgusting in the eyes of the Yidden and thereby caused a tremendous Kiddush Hashem.
On a similar note, the Ohr Hachayim writes as well in another place in this weeks Parsha, that G-d commanded the Jews "Tzror es Hamidyanim Ve'hikesem Osam" - meaning, "Make the Midyanim hated in your eyes and destroy everything of theirs". So the Ohr Hachayim asks, why do we need to hate them and destroy everything, why not be able to benefit from the booty of the enemy? And he answers that when it comes to immoral sexual conduct (that the Midyanites caused the Yidden to sin in), the only way for the Jews to receives G-d's forgiveness and atone properly would be if they turn their hearts to hate these sins, and destroy all that is related to it. For as long as the lust of the sins remain alive in a Jew's heart, he cannot properly atone for sins of a sexual nature. Instead, he must try to first arouse a disgust and hatred of these sins in his heart - and then he can achieve a true Teshuvah.