"Phinchas, the son of Eleazar, the son of Aaron the priest, has turned My anger away from the people of Israel." (Bamidbar 25:11)
By taking Kozbi, the Midianite woman, in front of the entire Jewish people, Zimri - prince of the tribe of Shimon - was guilty of Pgam Habris (sexual transgression). On the other hand, Pinchas received the priesthood by the merit of his zeal for Hashem in this incident.
Thanks to Pinchas, the concept of "Tikun Habris" ("the spiritual repairing of a sexual transgression") was brought into the world. In exchange, he received the priesthood, which corresponds to the "Holy love that is beside the point", that is to say, the covenant of peace, as it is written (Bamidbar 25:12 ): "I give to him My covenant of peace."
Pinchas's reaction against that forbidden relationship was a Tikun (spiritual reparation) to submit and cancel the kelipa ("forces of evil") of Balaam, as written below (31: 16): "These [the Midianites women] caused the people of Israel, through the counsel of Balaam, to commit trespass against the Lord ..."
In fact, Balaam was the true personification of the Pgam Habris. He was really sick in this area, which made him disgusting and abominable. Our Sages have said (Sanhedrin 105b): "He was attracted by this desire all his life." He did not even try not to follow the desires of his heart - which he could have done - if he had used Holy words (diburim kedoshim).
Holy words have an aspect of "three points" (Likutey Moharan 34). That is to say: the Holy words that are said between a person and his Creator, between a person and his friend when he speaks of the fear of Heaven and between a person and a Tzaddik. With these Holy words, even the most despicable person can get out of the depths of the pit of spiritual descent and deserve to get closer to Hashem.
The wicked Balaam and his students have no desire for the Holy words. It is bad enough in itself to be attracted by these kind of sexual desires, but in addition they do not even try to use the Holy words in their three aspects to emerge from the pit!
To add insult to injury, they even sully their power of speech. They pollute their power of speech - which was given to them by G-d - with a speech that lacks serious, with gossip, slander... They use futile and bad words.
These people are particularly guilty of using derogatory words against Tzaddikim and honest people. In doing so, they definitely put away the "three points."
Consequently, they sink ever lower in their perverse desires. However, this is not enough for them: they must involve other people with them. Their favorite target is the Jewish people. Their bad words - which have an aspect of Balaam the evil - push away the individuals from a positive evaluation about themselves.
Thanks to G-d, we have real Tzaddikim that illuminate the positive aspects which are in every Jew. They do this by using their power of speech, that is to say by using appropriate and encouraging words.
(Adapted from Rabbi Nathan of Breslov, Likutey Halakhoth, Orach Chaim, Hilkhoth Nissiath Kapayim 5:12)