Question: May one pray while wearing sandals or while one is barefoot?
Answer: When one prays, one must prepare one’s environment, clothing, body, and thoughts accordingly, for one will be standing before the King of all kings.
Respectable Garments While Praying
The Gemara (Shabbat 9b) derives from the verse “Prepare yourself before your G-d, Israel” that one must dress properly before praying to the King of all kings. One must make sure one’s clothing is befitting for one standing before a king.
Mode of Dress Depends on One’s Place
Based on the above, the Rambam (Chapter 5 of Hilchot Tefillah, Halacha 5) writes that one should not pray when one’s feet are uncovered, for one would not stand before a king or a high official barefoot. The Rambam adds that this depends on “whether the custom in that place is to stand before important people only while wearing shoes,” for if this is the case, one may not pray without shoes. However, in a place where people stand before important people even barefoot, one may pray in this manner as well.
The Gemara (Chagiga 13b) states, “It is improper to reveal one’s feet before the Master,” i.e. before the Almighty Hashem.
Maran Ha’Bet Yosef (Chapter 91) explains that it is only improper to reveal one’s feet in a place where the custom is to cover them; however, in places where it is common to walk around barefoot, such as in all Middle Eastern countries where it is customary to pray barefoot, this is not prohibited whatsoever, for one would stand this way before important officials as well. Maran explains that all opinions are in agreement to this law.
This is especially true regarding Middle Eastern countries where it was customary to remove one’s shoes before entering the synagogue (Responsa of the Rashbash, Chapter 285 and Birkei Yosef, Chapter 151) as a show of respect; in these places, one may pray barefoot. Only in places where people walk around wearing shoes should one not pray barefoot.
Thus, halachically speaking, in a place where people always walk around in sandals, one may pray while wearing sandals. Nevertheless, it is not customary to walk around completely barefoot anywhere nowadays and it is certainly customary to stand before an important official while barefoot. One should therefore not pray barefoot even nowadays. There is no difference between one praying alone or along with the congregation (Shabbat 10a) and in any event, one may not pray barefoot.