There was a community in America whose shul was too small for the many mispallelim who came to daven there on the Yamim Noraim. They wanted to rent a large hall nearby to hold the tefillos, but because this hall was used during the year to hold raucous and immodest parties, the community asked the Tchebiner Rav, the author of Dovev Meisharim – if one can rent such a hall for davening.
At the beginning of his response, the Rav mentions the words of Chazal (Brachos 59a): “Ein kateigor na’aseh saneigor” – the prosecutor cannot become the defendant, and in light of this, wonders, “how is it possible that a place where such immodest singers and the like are heard is chosen as a place where tefillos and tekiyos can be accepted?”
He then explains that it’s important to take into consideration the place where one davens, because when one davens in a holy place, the segulah of that place helps the tefillah be accepted. This concept is learned in the She’iltos DeRav Achai (Vayeitzei She’ilta 22) from the words of Chazal (Chulin 91b), that after Yaakov came to Charan he sought to return to Har Hamoriah, saying, “Is it possible that I passed the place where my ancestors prayed and I didn’t pray?” Just like Yaakov wanted to daven in a place that his forebears had designated for tefillah, likewise, every Yid should daven in a shul, which is a place designated for tefillah.
The Rav then added an explanation of the words of Chazal (ibid) on the passuk “Vayifga bamakom,” that as soon as Yaakov resolved to go back and daven in the place where his ancestors davened, the way was shortened for him and he found himself at Har Hamoriah. So the miraculous kefitzas haderech that he experienced is a directive for generations that indeed, a person has to daven in a place that is designated and sanctified specifically for tefillah.
Kovetz Yeshurun, Vol. 13, p. 270