In the second chapter, the Rambam discussed various halachot regarding the proper state of mind necessary for the reciting of the Shema. In Chapter 3, the discussion centers on the proper physical surroundings required for the performance of the mitzvah and those situations that preclude its fulfillment.
Deuteronomy 23:10-15 discusses the laws regarding army camps, giving as a fundamental guiding principle: "God walks among your camp, therefore,... your camp must be holy" (ibid.., 15). Included in that guideline is the obligation for every soldier to carry a spade in order to cover his excrement (ibid.. 23:14). (See Positive Commandments 192 and 193 in Sefer HaMitzvot of the Rambam, Hilchot Melachim 6:14-15.)
Since these laws were instituted because "God walks among your camp," it follows that they are also relevant when the Jews attempt to relate to God through prayer. Thus, these verses also serve as the source for the laws regarding the prohibition of reciting the Shema in the presence of feces as discussed in this chapter.
Commenting on the above verses, the Sifri states: "From here, we are taught that one should not recite the Shema next to the soakings of the clothes washers" - i.e., that one should not recite the Shema in a place where there is a foul odor or an unclean substance.
One who recites the Shema should wash his hands with water before reciting it.
If the time for reciting the Shema arrives and he cannot find water, he should not delay his recitation in order to search for water. Rather, he should clean his hands with earth, a stone, or a beam [of wood] or a similar object, and then recite.
One should not recite the Shema in a bathhouse or latrine - even if there is no fecal material in it - nor in a graveyard or next to a corpse. If he distances himself four cubits from the grave or the corpse, he is permitted to recite it. Anyone who recites in an improper place must recite the Shema again.
The Shema may be recited facing, but not inside, a latrine that has been newly built, but not used as of yet. [In contrast,] the Shema may be recited in a new bathhouse.
In the case of two buildings, one of which was designated for use as a latrine and, concerning the other, the owner said: "And this..." - a doubt remains regarding the latter: whether it also was appropriated for a similar use or not.
Therefore, one should not deliberately recite the Shema there. However, after the fact, if he recited it there, he has fulfilled his obligation.
If the owner said: "Also this," both have been designated for this use, and the Shema may not be recited in them.
It is permissible to recite the Shema in the courtyard of the bathhouse, i.e., the place where people stand clothed.
Not only Kri'at Shema, but nothing pertaining to matters of sanctity may be uttered in a bathhouse or latrine, even in a language other than Hebrew.
Not only speech, but even thoughts pertaining to the words of Torah are forbidden in a bathhouse, latrine or other unclean places - i.e., a place where feces or urine is found.
Secular matters may be discussed in a latrine, even in Hebrew. Similarly, the terms used to express Divine attributes, such as merciful, gracious, faithful and the like, may be uttered in a latrine.
However, the specific names of the Almighty - i.e., those which may not be erased - may not be mentioned in a latrine or bathhouse that has been used. If a situation arises where it is necessary to restrain someone from wrongdoing, this should be done, even in Hebrew and even concerning matters of sanctity.
The Shema may not be recited in the presence of human feces, or in the presence of dog or pig excrement while skins are soaking in it, or in the presence of any other feces like these that have a foul odor. This is also the case regarding human urine, but not animal urine.
One need not distance oneself from the feces or urine of a child unable to eat the weight of an olive of grain cereal, in the time in which an adult could eat an amount equivalent to the weight of three eggs.
One may not recite the Shema next to feces, even if they are as dry as a shard. However, if they were so dry that, if thrown away, they would crumble, one may recite the Shema facing them.
If urine that has been soaked up into the ground is still sufficiently wet to moisten one's hand, the Shema should not be recited facing it. If it has dried sufficiently, the Shema may be recited.
How far must a person distance himself from feces or urine in order to recite the Shema? Four cubits. This applies when they are at his side or behind him, but if they are in front of him, he should move until he cannot see them, and then recite [the Shema].
When does the above apply? When he is in an enclosure with them, and they are on the same level. However, if they are 10 handbreadths higher or lower than he, he may sit next to them and recite the Shema, since there is a space separating them.
The above applies provided no foul smell reaches him. Similarly, if he were to cover the feces or urine with a vessel, it would be considered as buried, even though it would still be in the room, and it is permitted to recite [the Shema] next to it.
A person who is separated from feces by a glass partition, may recite the Shema next to them even if he can still see them. If a quarter log of water is added to the urine of one micturition, the Shema may be recited within four cubits of it.
If feces are found in a hole in the ground, a person may stand with his shoe over the hole and recite the Shema. However, his shoe may not touch the feces.
If one finds very small feces, the size of a drop, he may expectorate thick saliva upon it to cover it, and then recite the Shema.
When there is a residue of feces on one's skin or one's hands are dirty from the washroom, if - because of the small quantity or its dryness - there is no foul odor, he may recite the Shema, since there is no foul odor.
However, if it is still in its place, even if not visible when he stands, since it is visible when he sits, he is forbidden to recite the Shema until he cleans himself very well. This is because of the moist nature and foul smell of the feces.
Many Geonim taught that one is forbidden to recite the Shema if one's hands are soiled, and it is proper to heed their teaching.
[When the source of] a foul odor has substance, one may distance himself four cubits and recite the Shema provided the odor has subsided. If it has not subsided, he should distance himself further until it ceases.
If [the odor] is not emanating from an actual substance - e.g., it is the result of someone passing gas - he should distance himself until the odor ceases and [then] recite.
It is forbidden to recite the Shema in front of a cesspool or chamber pot, even if it is empty and has no foul smell, as it is similar to a latrine.
It is forbidden to recite the Shema while facing moving excreta - e.g., excreta floating on the water. The mouth of a pig is regarded as moving excreta. Therefore, the Shema may not be recited facing it, until it has moved four cubits away.
A person who reaches an unclean place while he is walking and reciting the Shema, should not place his hand over his mouth and [continue] his recitation. Rather, he should stop reciting until he has passed this particular place.
Similarly, if one is reciting [the Shema] and passes gas, he should stop until the odor subsides and resume his recitation afterwards. The same applies to one studying Torah.
When another person passes gas, even though one should stop reciting the Shema, he need not interrupt his Torah study.
A person is permitted to continue reciting the Shema if a doubt arises whether feces or urine is found in the house in which he is located.
In contrast, a person reading the Shema in a garbage heap is not permitted to continue reading if a doubt arises regarding the presence of feces until he checks [that it is clean] because a garbage heap may be presumed to contain feces. If the doubt exists only regarding urine, however, the Shema may be recited even in a garbage heap.
Just as it is forbidden to recite the Shema where there are feces or urine until one distances himself from it, so, too, the Shema may not be recited in the presence of nakedness, unless one turns his face away.
This applies also to a non-Jew or a child. Even if a glass partition separates him from them - since he sees them - he must turn his face away in order to recite the Shema.
Any part of a woman's body is regarded as ervah. Therefore, one should not gaze at a woman, even his wife, while reciting the Shema. If even a handbreadth of her body is uncovered, he should not recite the Shema facing her.
Just as one may not recite the Shema in the presence of another's nakedness, so, too, is he forbidden to do so when he himself is naked. Therefore, one may not recite the Shema when he is naked until he covers his nakedness.
If his loins are covered with cloth, leather or sack, even though the rest of his body is exposed, he may recite the Shema, as long as his heel does not touch his genitalia.
If he is lying under his sheet, but is otherwise naked, he should make a separation by placing his sheet below his heart, and [then] recite the Shema. He should not, however, make a separation from his neck [downward] and recite, because his heart will see his nakedness, and it is as if he is reciting without any loin covering.
When two people are lying under one sheet, each is forbidden to recite the Shema even if he has covered himself below his heart, unless the sheet also separates between them in a manner that prevents their bodies from touching from the loins downward.
If he is sleeping with his wife, children or other young members of his household, their bodies are considered like his own, and he is not affected by them. Therefore, even though his body is touching theirs, he may turn away his face, separate below his heart and recite [the Shema].
Until when is one considered a child concerning this matter? A boy, until 12 years and one day; a girl, until 11 years and one day.
[When they reach that age, they are only excluded when] their physical characteristics are like those of adults - i.e., developed breasts and pubic hair. From this time onwards, one may not recite the Shema unless he has first separated himself from them with the sheet.
However, if they have not yet developed breasts or pubic hair, he may still recite [the Shema while lying] in physical contact with them, and need not separate from them until the boy is 13 years and one day, and the girl 12 years and one day.