When we are wearing tefillin, our bodies must be clean inside and out, and tefillin may not be worn when we are conscious of repulsive body wastes.
The gemara illustrates this halacha by an inspiring but seemingly unrelated story. It states, “Tefillin require a clean body like Elisha of the wings”. Yet the passage does not go on to say how clean Elisha was when he wore tefillin, but rather the self-sacrifice he displayed to fulfill this mitzva. Elisha disdained the decree of the Edomite (Roman) author- ities forbidding tefillin, and wore them publicly. Once he was noticed and chased by a soldier; he managed to remove his tefillin and hide them in his hand.
When the soldier asked what he had in his hand, Elisha replied that they were dove’s wings; and his spirit of sacrifice was requited by a remarkable miracle: the tefillin were indeed transformed into dove’s wings (Shabbat 49a).
Rav Kook explains how this miracle relates to the idea of cleanliness for tefillin. He writes that tefillin represent the unique spiritual level of the chosen Jewish people, who have a unique covenant with HaShem. However, this level needs to be built upon a solid foundation of integrity and thoughtful conduct in everyday affairs. This is the Divine inheritance of all mankind, and is expressed through the mundane but crucial prerequisite of “a clean body”.
Once this foundational, universal ele- ment of derekh eretz is firmly ingrained, the tefillin are like birds wings which enable us to soar above this level. (Afterwards the gemara explains that the wings were specifically those of a dove, since we find elsewhere that the mitzvot, which pro- tect the Jewish people, are likened to the wings which protect the dove. So the mitzvot simultaneously protect us where we are and also elevate us to higher levels of consciousness.)
True self-sacrifice for an ideal is found only in a person who is completely capable of realizing this ideal. Elisha became the exemplar for having a clean body for tefillin, because his legendary devotion to the mitzva of tefillin was only possible because he attained the highest level of performance; and this level testifies to a firm basis of bodily cleanliness and spotless ethical behavior. — Ein Ayah Shabbat 49a