Q. When staying over Yom Tov in a hotel, can I place a Mezuzah on my room door, for shemira since the door is not locked on Shabat and Yom Tov? Is it advisable? Can I put one in a condo I rent only for Yom Tov?

Q. When staying over Yom Tov in a hotel, can I place a Mezuzah on my room door, for shemira since the door is not locked on Shabat and Yom Tov? Is it advisable? Can I put one in a condo I rent only for Yom Tov?

A. Rambam (H. Mezuza 5: 4) rules that those who write on the mezuza’s parchment the names of angels or other unnecessary holy names, are included with the ones who forfeit their part in the world to come. Not only did they not comply with the mitzvah, but it is as if they turned a great mitzvah that represents the unity of Hashem’s name, His love and the service to Him, into a simple worthless amulet for one’s personal use. Kesef Mishne (ibid.) explains that although it is amply mentioned in the Talmud that a mezuza does provide shemira and protection, our intention should be only to comply with the will of Hashem and his mitzvos, the shemira will in due course come by His desire. More stringent is the opinion of the Ginas Verodim (O.H. 1: 2: 28) who writes that affixing a mezuza with the intention of protection and security and not for the compliance of the mitzvah, has exactly the opposite effect and is considered a sinful act. Sdei Chemed (5: mem: 114) likewise includes in the above, the one who while being exempt of a mezuza affixes it anyway to protect him from mazikim and evil spirits.
However, not all Poskim agree. They quote the Talmud Yerushalmi (end of Megila) that the court of the Jewish King Moonbaz would affix the mezuzos as a “remembrance” while staying in a hostel, though they were not required to do so by law. (D’var Yehoshua 3: 51, Ma’adanei Yom Tov 32, Kuntres Zera Yaakov 17: p. 16, Chabad.org quotes that such was the practice of the fifth Rebbe of Lubavitch, Rabbi Shalom Dovber the Rashab). See also Chasam Sofer (E.H. 2: 90) who argues that if the words of the Rambam were to be taken literally, the majority of the Jewish nation would not comply with the mitzva of mezuza.
Horav Shlomo Miller’s Shlit”a opinion is that indeed when totally exempt of mezuza, as when staying in a hotel or a vacation condo-rental for less than thirty days, it is preferable not to place a mezuza.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit”a