Our teacher, the Beit Yosef, wrote that from the words of the Rambam it appears that it is forbidden to urinate while they are on his head, whether in a permanent beit hakise or in a temporary beit hakise. And one should be concerned for his words. Thus far his words. This is the wording of the Rambam in the fourth chapter, law 17: If one was wearing tefillin and needed the beit hakise – he should not leave the tefillin in holes adjacent to the public domain and enter, lest passersby take them. What should he do? Even if he needed to urinate water – he removes his tefillin at a distance of four amot, and rolls them in his garment like a Sefer Torah, and holds them in his right hand opposite his heart. And he should be careful so that a strap does not protrude a tefach from under his hand. And he enters and performs his needs. And when he exits, he distances himself four amot from the beit hakise and wears them. In what case are these things said? In a permanent beit hakise, where sparks do not splash upon him. But in a temporary beit hakise – he shall not enter with them while they are rolled, but rather he removes them and gives them to his fellow to guard them. And urine does not cease except by sitting, or in loose earth, or in a sloped place. Thus far his words. And we have already written that the great authorities explained that therefore he forbade even in a temporary one when urinating while they are on his head because of the concern of flatulence, and not that there is an intrinsic prohibition to urinate in tefillin as there is a prohibition with excrement. But in my humble opinion, it does not appear so from his words there, as he wrote: If he forgot and entered the beit hakise while he was wearing tefillin – he places his hand upon them until he finishes the first stream, and exits and removes them, and afterward enters and performs his needs. For if he interrupts the first stream, whether with excrement or with urine – he will come to illnesses in which there is great danger. Thus far his words; behold, he wrote this law even regarding urine. And if it should enter your mind that there is no prohibition in this from the essence of the law, but only because of the concern of flatulence, why did they not permit him to finish? Rather, certainly he holds that from the essence of the law it is forbidden to urinate in tefillin.
וכתב רבינו הבית יוסף שמדברי הרמב"ם נראה שאסור להשתין כשהם בראשו, בין בבית הכסא קבוע ובין בבית הכסא עראי. ויש לחוש לדבריו. עד כאן לשונו. וזה לשון הרמב"ם בפרק רביעי דין י"ז: היה לבוש תפילין והוצרך לבית הכסא – לא יניח התפילין בחורין הסמוכין לרשות הרבים ונכנס, שמא יטלום עוברי דרכים. כיצד יעשה? אפילו הוצרך להשתין מים – חולץ תפיליו בריחוק ארבע אמות, וגוללן בבגדו כמין ספר תורה, ואוחזן בימינו כנגד לבו. ויזהר כדי שלא תהא רצועה יוצאת מתחת ידו טפח. ונכנס ועושה צרכיו. וכשיצא מרחיק ארבע אמות מבית הכסא ולובשן. במה דברים אמורים? בבית הכסא הקבוע, שאין ניצוצות ניתזין עליו. אבל בית הכסא עראי – לא יכנס בהם כשהם גלולים, אלא חולץ אותם ונותנם לחברו לשמרן. ואין מי רגלים כלים אלא בישיבה, או בעפר תיחוח, או במקום מדרון. עד כאן לשונו. וכבר כתבנו שהגדולים פירשו דלכן אסר גם בעראי במשתין כשהם בראשו משום חשש הפחה, ולא שיש עצם איסור להשתין בתפילין כמו שיש איסור בגדולים. אבל לעניות דעתי לא נראה כן מדבריו שם, שכתב: שכח ונכנס לבית הכסא והוא לבוש תפילין – מניח ידו עליהן עד שיגמור עמוד ראשון, ויוצא וחולץ, ואחר כך נכנס ועושה צרכיו. שאם יפסיק בעמוד ראשון, בין בגדולים בין בקטנים – יבוא לידי חלאים, שיש בהם סכנה גדולה. עד כאן לשונו, הרי שכתב דין זה גם על קטנים. ואי סלקא דעתך דאין בזה איסור מעצם הדין, רק משום חשש הפחה, למה לא התירו לו לגמור? אלא וודאי דסבירא ליה דמעצם הדין אסור להשתין בתפילין.