The Gemara (Berachos 20b) states that Ezra instituted that people who contract a certain type of tumah (baal keri) may not study Torah until they immerse in a mikveh. The Mishnah says that a person in such a state of tumah may not say Krias Shema; rather, he must mentally think the words.
The Gemara deduces from this rule that a person may fulfill his obligation of Krias Shema without actually saying the words. Ravina concludes that thinking must be considered speaking (hirhor k’dibur), which is why a person can fulfill his obligation by merely thinking the words.
The Gemara asks: If thinking is considered speaking, how can a baal keri think the words of Shema? If he can think them, he might as well say them.
The Gemara answers that we find a precedent for this distinction. Tosafos explains that before Bnei Yisrael accepted the Torah at Har Sinai they were required to immerse in a mikveh in preparation for speaking the words of the Torah. The Chumash never says that Bnei Yisrael spoke the words of the Torah, but the Gemara says they did because shomei’a k’oneh – listening is like saying. Therefore, by listening to Hashem recite the Asseres Hadibros, Bnei Yisrael effectively said them themselves.
Apparently Tosafos differentiates between the halacha of shomei’a k’oneh, which equates listening with saying, and hirhor k’dibur, which equates thoughts with words. When a person listens to another recite words, he is considered to have spoken them himself and this presents a problem if he is tamei. One is permitted, though, to merely think the words.
The Brisker Rav in his sefer on Chumash explains that Bnei Yisrael effectively said the Aseres Hadibros because, as Rashi (Shemos 19:9) points out, they told Moshe that they wanted to hear it directly from Hashem, not through Moshe. Had they not said that – had Moshe said the Aseres Hadibros in Hashem’s name – the rule of shomei’a k’oneh would not have applied.
Some (Teshuvos Yad Eliyahu Ragaler) derive from this Gemara that while someone whose hands are unclean may think words of Torah without washing his hands, he may not study Torah nor may he listen to someone else studying Torah. They opine that any form of listening to words of Torah is comparable to what Bnei Yisrael did at Har Sinai.
In my opinion, the two are not the same. At Har Sinai, Bnei Yisrael accepted the Torah. They weren’t merely listening to words of Torah; they were accepting the Torah’s laws upon themselves. Thus, by listening To Hashem’s words, they were effectively saying them themselves. The same cannot be said about listening to a shiur or a friend studying Torah out loud. There is no reason to assume that listening is like saying in such cases. Therefore, it should be permitted to hear a shiur or words of Torah even if one is unclean.
Today the prevalent minhag is not to be particular about studying Torah while one is tamei. Certain roshei yeshivos, however, have accepted a chumra upon themselves of not delivering a public shiur in an impure state.