Q. I wonder Kvod Horav why is it that in our days we are not supposed to daven barefoot in Shul when in ancient times it was preferred?
A. It is obvious that in Biblical times, it was correct to remove one's shoes before praying to Hashem as mentioned (Shemos 3: 5): And He (Hashem) said (to Moshe), "Do not come closer. Take your shoes off your feet, because the place upon which you stand is holy ground :
In Yehoshua (5: 15) The captain of Hashem's’s host answered Yehoshua, “Remove your shoes from your feet, for the place where you stand is holy.” And Yehoshua did so.
We well know that in the Beis Hamikdash the Cohanim performed the Avoda barefoot. Talmud, (Zevahim 24a) quotes Rabi Ishmael: “Just as with regard to service vessels, nothing may interpose between [the Priest] and the service vessel, so too with regard to the floor, nothing may interpose between [the Cohen] and the floor.” This Halachah was codified by the Rambam (Bi’as Hamikdash, 5: 17).
Moreover, the Mishnah (Berakhot 9: 5) teaches that all people entering Har Habbais would also remove their shoes as mentioned: “One should not enter the Temple Mount with a staff, or with shoes on, or with a money belt, or with dusty feet."
Even in much later times in some places they would take off shoes before entering Shul, as Talmud Yerushalmi (Bava Metzia 2: 8) relates that; 'Yehudah B'ribbi entered a Beis Midrash and left his sandals outside the door. When he returned he realized that they were gone (stolen). He said: Had I not gone to the synagogue, my sandals would not have gone!'
See also Mishnah Megillah (4: 8) “One who says: I will not pass before the ark wearing sandals, he may not pass before it even barefoot
However it was not universal anymore as great importance was given to wearing shoes, as Talmud (Shabbos 129a) tells; “Rav Yehuda said in the name of Rav: One should always sell the beams of his house and purchase shoes for his feet” or “One wearing shoes on his feet — is a human being” (Shabbos 152a)”. See also Talmud Shabbos (10a) Rabbah bar Rav Huna would don 'puzmaki' and pray. He said: “Prepare to greet your G-d, Israel!”
See next question.
Rabbi A. Bartfeld as revised by Horav Dovid Pam, Horav Aharon Miller and Horav Chanoch Ehrentreu Shlit'a