The Medrash (Vayikroh Rabbah 26:1) states: “’Say to the kohanim, the sons of Aharon, and say to them.’ This is as is stated (Tehillim 12:7): ‘The words of Hashem are pure, like silver refined exposed to the earth, purified seven times.”
Sefer Imrei Noam understands this to be teaching us to avoid pointless conversations and to stay away from gatherings of wicked people and non-Jews, associating with them only when necessary for parnassah reasons. However, one should be willing to make himself impure if such associations are needed to do a mitzvah or to help a fellow Jew.
Accordingly, the pasuk says that one should not become tamei to a “nefesh in your nation.” The word “nefesh” refers to the power of speech, as is stated “Bereishis 2:7): “l’nefesh chaya”, which Targum Onkelos translates to mean “a spirit of speech”. The word “b’amav” (in your nation) refers to degraded people, as the word “am” is a reference to the eirev rov and wicked men (see Zohar, Chelek 2, 45B). Thus, the pasuk is warning us not to make our mouths impure by speaking to such people.
However, it then says that one may make his mouth impure “l’she’eiro... for his relative who is close to him.” This is a reference to parnassah, as “she’eir” is a word used for one’s livelihood (see Kesuvos 47B). Accordingly, the pasuk is saying that one may speak to such people for parnassah reasons.
Chazal add that the exception to the rule is a case of a “meis mitzvah”, when it is permitted to become impure. Thus, we see that one may make his mouth impure by speaking to reshaim if this enables him to do a mitzvah. The Medrash cites the verse that says that words for Hashem are pure to tell us that if the words one says are for the sake Heaven – for the sake of a mitzvah – then they remain pure and will not harm a person. So too, if the words are “like silver refined”, meaning that they are for the sake of parnassah, they will also remain pure.