שולחן ערוך
אסור ליכנס אבבית הקברו' או בבתוך ארבע אמות של מת ותפילין בראשו משום לועג לרש ואם הם מכוסים גמותר:
It is forbidden to enter a cemetery or to come within four cubits of a corpse while tefillin are on his head because this is 'mocking the poor' (flaunting a mitzvah before the dead, who can no longer perform it) but if they (the tefillin) are covered, it is permitted.
בבית המרחץ דבבית החיצון שכל העומדים בו הם לבושים יכולים להניח שם תפילין לכתחלה ובבית האמצעי שמקצת בני אדם עומדים שם לבושים הומקצתן ערומים אינו יכול להניחם לכתחלה ואם היו בראשו א"צ לחלצן וובבית הפנימי שכל העומדים שם ערומים אפילו היו בראשו צריך לחלצן:
Regarding a bathhouse: in the outer room, where everyone standing there is dressed, one may put on tefillin there even at the outset (l'chatchilah). But in the middle room, where some people stand dressed and some are naked, he may not put them on at the outset; yet if they were already on his head, he need not remove them. And in the inner room, where everyone standing there is naked, even if they were already on his head, he must remove them.
משנה ברורה
(א) בבית הקברות - ואפילו תוך ד"א של מקום התחלת הקברים ג"כ אסור אי ליכא מחיצה מפסקת ביניהם והא דלא עירב ביחד ויאמר אסור לילך תוך ד"א של קבר או של מת דעת המ"א דבא לרמז דממקום בה"ק ולפנים אסור אפי' רחוק ד"א מן הקבר ויש מקילין בזה ועיין בבה"ל דבאמצע בה"ק שיש קברים סביב נראה דיש להחמיר אפילו רחוק ד"א מן הקבר משא"כ בסוף בה"ק דאין שם קברים רק דהוקצה הקרקע לקברים אין להחמיר מדינא ברחוק ד"א מן הקבר ואעפ"כ נכון שלא יכנוס כלל בתפילין שבראשו כל שהוא לפנים ממחיצת בה"ק שמא יתקרב בתוך ד"א של איזה קבר בלי דעת:
(1) 'A cemetery' — even within four cubits of the spot where the graves begin it is likewise forbidden, if there is no partition separating him from them. As for why the ruling did not simply combine the two and state 'it is forbidden to walk within four cubits of a grave or of a corpse' — the Magen Avraham's view is that it comes to hint that from the boundary of the cemetery inward it is forbidden even when he is more than four cubits from any grave; and some are lenient in this. See the Biur Halacha: in the middle of the cemetery, where there are graves all around, it appears that one should be stringent even more than four cubits from a grave; whereas at the edge of the cemetery, where there are no actual graves and the ground has merely been designated for graves, one need not, by strict law, be stringent when he is more than four cubits from a grave. Even so, it is proper not to enter at all with tefillin on his head once he is inside the partition of the cemetery, lest he unknowingly come within four cubits of some grave.
(ב) בתוך ד"א וכו' - וכתב העט"ז דכל אותו חדר שהמת מונח בו חשוב כד"א של מת ומגן גיבורים חולק עליו וכתב דאינו תופס רק ד"א עי"ש ואפילו קבר של קטן שעדיין לא הגיע לכלל מצות אפ"ה אין לכנוס שם בתפילין בראשו משום לועג לרש:
(2) 'Within four cubits, etc.' — the עט"ז writes that the entire room in which the corpse lies is treated like the four cubits of the corpse; but the Magen Giborim disagrees with him and writes that it takes hold only of the four cubits — see there. And even at the grave of a child who had not yet reached the age of mitzvos, even so one may not enter there with tefillin on his head, because of 'mocking the poor.'
(ג) מותר - וצריך שגם הרצועות תהיינה מכוסות לפיכך אע"פ שמותר לכנוס בתש"י לבדה הואיל והוא מכוסה צריך ליזהר ברצועה שעל אצבעו שתהיה ג"כ מכוסה [ט"ז]:
(3) 'It is permitted' — and the straps too must be covered. Therefore, although one may enter wearing only the hand-tefillin, since it is covered, he must take care that the strap on his finger also be covered [the Taz].
(ד) בית החיצון - שדרכם היה לאחר שלבשו החלוק בבית האמצעי לילך לבית החיצון ולגמור הלבישה:
(4) 'The outer room' — for their practice was, after putting on the tunic in the middle room, to go to the outer room and finish dressing.
(ה) ומקצתן ערומים - י"א דאם עתה אין שם אדם ערום מותר להניח בו תפילין ולברך ויש אוסרין כיון דהמקום מיוחד לזה דין מרחץ עליו במקצתו. ובית הטבילה משמע בט"ז סי' פ"ד דדין בית אמצעי יש לו לכל דבר ורק ברכת הטבילה מותר לברך בה עי"ש טעמו. ומהמ"א בסימן זה משמע דבאין בה אדם ערום מותר להניח בה תפילין ולברך דדוקא במרחץ החמירו אע"פ שאין שם אדם משום שזוהמתו רבה מהבל החמין שמשתמשין בה משא"כ במקוה [ואם שופכין בה ג"כ חמין יש לעיין] אבל אם יש שם אדם ערום אסור לכנס בה בתפילין וכתבי הקודש דאסור לעמוד לפני השם ערום ועיין לקמן בסימן פ"ד במ"ב בענין זה:
(5) 'And some are naked' — some say that if right now there is no naked person there, one may put on tefillin in it and recite the blessing; and some forbid it, since the place is designated for this and therefore partially carries the status of a bathhouse. As for the immersion room, it is implied in the Taz, siman 84, that it has the status of the middle room for every matter, and only the blessing over immersion may be recited in it — see there his reasoning. And from the Magen Avraham in this siman it is implied that when no naked person is in it, one may put on tefillin in it and recite the blessing, for only in a bathhouse were they stringent even when no person is present, because its filth is abundant from the steam of the hot water used in it, unlike a mikveh [though if hot water is also poured into it, the matter requires examination]. But if there is a naked person there, it is forbidden to enter it with tefillin or sacred writings, for it is forbidden to stand naked before the Name. See further on, in siman 84, in the Mishnah Berurah, on this matter.
(ו) ובבית הפנימי - בזה לכו"ע אפילו אין שם אדם ערום דנפישא זוהמיה וכבית הכסא דמיא:
(6) 'And in the inner room' — in this case, according to all opinions, even if no naked person is there (it is forbidden), because its filth is great, and it is comparable to a privy.