When Lashon Hara is a Mitzvah
A while ago - I forget the details - I was telling some people about how a certain person posed a harmful influence. One person objected that this was lashon hara. When I pointed out that it was leto'eles, for public benefit, this person argued that it is still only permissible if the speaker's motivations are pure. Since my motivations were suspect, then it was not permissible.
Now, the first observation to be made here is that Rabbi Yisrael Meir Kagan's "Laws" of lashon hara are not "laws" in the same sense as the laws of Shabbos found in the Shulchan Aruch. A must-read on this topic is Benjamin Brown's "From Principles to Rules and from Musar to Halakhah: The Hafetz Hayim’s Rulings on Libel and Gossip," which you can read at this link. Furthermore, while the Chafetz Chaim's conclusions became the standard for much of the Orthodox community, this was primarily simply due to his being the first person to systematically discuss the topic.
But what about within the parameters of the Chafetz Chaim's framework? Is it truly forbidden to warn people of someone's faults if one's motivations are not pure? Surely this makes no sense - why should these other people be put in harm's way just because of one's own shortcomings?
If we look at the Chafetz Chaim's discussions of this topic, an interesting discrepancy can be seen. When discussing the laws of lashon hara and cases where it is permitted in order to help others, he lists purity of intent as being an essential condition (Hilchos Lashon Hara 10:2). But later, when discussing the laws of rechilus (tale-bearing) and cases where it is permitted in order to help others (Hilchos Issurei Rechilus 9:2), while he likewise lists pureness of intent as being an essential condition, there is a footnote to his Be'er Mayim Chaim commentary. In the commentary, he notes that even if one does not have purity of intent, one must nevertheless still relate the rechilus. After all, we are discussing a case where it is in order to help others from being harmed, and there is a mitzvah of Lo Ta'amod Al Dam Re'echa, not to stand by when someone is going to be hurt. Rather, he says, when describing purity of motive as a requirement, he means that one should try as much as possible to focus on doing it for positive purposes.
Now, why did the Chafetz Chaim not make this same point in discussing cases where it is permitted to state lashon hara? I don't know, but it seem very clear that it should equally apply. Perhaps it was simply an oversight. (Alternately, looking carefully at the Chafetz Chaim's language in discussing lashon hara, it seems to me that he is talking about having proper motive insofar as assessing that there is a genuine chance of helping people, not in terms of one's inner motives. If I am correct, this is something that has been lost in the ArtScroll translation.)
One who sees the Chafetz Chaim's work as being a halachic work like the Shulchan Aruch will probably not apply this principle (that purity of motive is not an essential condition) to lashon hara, since the Chafetz Chaim didn't mention it there. But one who sees the concept of permitted and forbidden speech as being a rational matter of creating a moral society will likewise apply this principle to cases of permitted lashon hara. If it's a matter of stopping someone from harming others, then it doesn't make a difference what your personal motives are (except insofar as giving reason to doubly check that it really is a matter of stopping someone from harming others).
It is extraordinary that the works of the Chafetz Chaim, intended to make the world a better place, have often been used to make the world a worse place. Sometimes it is people not giving over harmful information about a shidduch, sometimes it is people not reporting dangerous behavior in a rabbi, sometimes it is people trying to quell frank discussion about social policies. The Torah's principles of speech are supposed to improve society. We have to use our sechel in applying them.