Prologue: Moshe needed to get out.
At the culmination of Parshas VaEra, at the end of Makkas Barad, Moshe tells Pharaoh that he will daven to have the Makkka removed only when he leaves the city (Shemos 9:29). Rashi comments that he was not able to daven in the city as it was filled with Avodah Zara.
Sifsei Chachamim raises an interesting question: Why was it only in regard to the Barad Makka that Moshe noted that he needed to leave the city? What about all of the times in the [previous Makkos when he WAS able to Daven in the city? What was unique about Barad?
Daas Zekanim notes that the people who feared Hashem, brought their animals into their homes. Animals served as the Avodah Zara of Egypt. Thus, while in other Makkos Moshe davened in the city, the animals were outside of it. Now that the animals were in the city, it was Moshe who had to leave it in order to daven.
The author of the Baruch Taam (in his sefer Baruch She’Amar R.H. 17a) offers an almost opposing position. He explains that Pharaoh knew that Moshe ALWAYS left the city in order to daven PRECISELY BECAUSE he couldn’t daven in front of the Avoda Zara. However, Pharaoh assumed that this time, when he declared that Hashem was correct and he and his nation errant, this declaration should count as Bittul Avoda Zara. To that Moshe responded that his Bittul was out of fear (See comment of Or HaChaim here) and thus his words were not an expression of truth. Any time that insincere motivation (fear) drives a non-Jew to nullify Avoda Zara, the nullification is nullified (See Y.D. 146:7 in Rema). Thus, despite Pharaoh’s expectation, Moshe needed to leave the city again – in order to seek Rachmanus.
Avoda Zara is but one item that limits one’s ability to connect to Hashem in its presence. This week’s Chaburah examines other situations where the ability to Daven and perform other mitzvos might be compromised. It is entitled:
Hashem is truly everywhere, but can I talk to him here?
The Torah reminds us that our camp is supposed to be Kadosh (Parshas Ki Tze Tze). The Gemara (Sotah 42b) deduces that the Aron that travelled with the Jewish nation in the Midbar had the name of Hashem on it and as a result, the camp had to be clean. Therefore when one needed to take care of his needs, s/he needed to leave the camp to do so. Thus, the Kedusha requires a physical cleanliness and a covering of Ervah. Thus, the environment of holiness is needed for the Kedushas Hashem to be achieved.
This leads the Shulchan Aruch (O.C. 76) to an awareness that at the time of the recitation of Kriyas Shema a location must be selected that is the environment of Kedusha. Mishna Berura (76:2) adds that this is not only true of the recitation of Shema but even the study of Torah, and all other prayers – whether recited in Lashon HaKodesh or Chol --- must be recited within an environment of Kedusha , clean and pure.
What about performing Mitzvos that do not have speaking attached to them? Can one take a lulav or wear Tzitzis in a place which is compromised on cleanliness? What about on a GI floor in a hospital? Could active Mitzvos be performed in front of the patients or by the patients themselves when their cleanliness might preclude them from being able to make a Beracha?
In regard to the permissibility of doing the Maaseh HaMitzva (the action of the Mitzva), it is clear that the Matteh Efrayim (O.C. 586:5) and the Biur Halacha 586:2 D”H Shama) are of the opinion that the matter is not forbidden. However, these and many other Poskim also make it clear that it is a Bizui Mitzva and should only be done in situations where there is no other choice, lest one come to contemplate the reasons for doing the Mitzva and the Kavannos and come to study Torah in a forbidden location. A good example of where this might be permitted is with a patient who is tied to his room which is not cleaned for whatever reason. (Matteh Efraim adds that if he CAN get to a clean environment later he should redo the Mitzva even without a Beracha). The Chida explains (Tov Ayin 18:37) that in order to perform a Mitzva, the needs to be clean and Tahor.
Darchei Teshuvah (Y.D. 19:21) adds that any Mitzva that is not Chiuvis (required) is exempt from this rule. Ergo, he explains why Shechita can be done in a place where the sheer nature of a slaughterhouse by definition is not usually clean.
Mitzvos that pass fast too, are not included. Thus, one still rises for a Talmid Chacham (Pitchei Teshuvah Y.D. 244:3) in a place that is not clean. Similarly, one can do Chessed or give Tzeddaka even in a bathhouse (Shut Lev Chaim II 173; Halichos Shlomo 20:37) as these mitzvos are fleeting.
In regard to the Tallis, there is room to be lenient for a Tallis Katan (See Minchas Shlomo I:1) but we tend to remove the Tallis Gadol before we go in.
In regard to realizing that Hashem is truly everywhere and contemplating his greatness, there is a long debate about that matter in the Poskim (See Hagahos Chochmas Shlomo to O.C. 85:2 and Mishna Berurah 85:5). It would follow that one who is not thinking Possukim but rather the greatness of Hashem would likely not be in violation because, after all, in those moments he knows that Hashem is truly everywhere.