Speaking in Shul
The Tzlach writes, "There is no greater rebellion against the King of the world than to speak in his heichel, in His presence. He is making the holy air tamei, similar to the Yevanim who made the mizbeiach tamei. Speaking during davening is like placing an idol in the heichel."
נוחלין יש, written by the Shlah HaKadosh's father, writes, "I swear, from all sins I saw, I never saw anything as bad, because what does one gain by speaking? For all other sins, such as theft, adultery, non-kosher foods, and the like, the yetzer hara is strong, and it sometimes pulls the person to sin because a person desires pleasures. But no yetzer hara pulls him to speak during davening? Furthermore, one never performs this aveirah by himself. There has to be at least two people. So he is ומחטיא חוטא, sinning and causing others to sin with him. The aveiros of many will be because of him. The worst part is that he is disgracing Hashem's honor in public, in the midst of the community, at the same holy time designated for praising Hashem..."
The Chasam Sofer (Drashos vol.2, 309:) said, "Hakadosh Baruch Hu with His immense mercy left us over a מעט מקדש. They are the batei knesiyos and batei midrashos. If we treat them with holiness, they will move to Eretz Yisrael... Even now, they have the kedushah of Eretz Yisrael. Tefillos go up from there to the gateways of heaven. However, if people disrespect the beis medresh and speak idle talk there, the Sar (the malach) from chutz le'aretz comes and becomes the head of the beis medresh, rachmana litzlan..."
Have Your Teϔillos Answered
Another problem that arises from speaking in the middle of the tefillah is that it prevents the tefillos of the congregation from going up. One should therefore be very cautious, and avoid speaking in the beis medresh, because he may be ruining the tefillah for everyone present.
The Chida zy’a writes that if one knows that he is going to speak during the tefillah, he'd be better off davening at home because his speaking prevents the tefillos from going up to heaven.
The Zohar (Vayakhel 205) teaches that speaking during the tefillah on Shabbos is an even greater violation. The Kaf HaChaim (151:8) explains that this is because speaking in the shul banishes the Shechinah. The Shechinah is more present in the shul on Shabbos; therefore, speaking on Shabbos during the tefillah is an even greater sin.
The Holiness of the Beis Medresh
15. The Gemara (Yevamos 6.) states, "It isn't that you are afraid of the Beis HaMikdash, rather you fear the One who dwells in the Beis HaMikdash." Similarly, we aren't afraid of the beis medresh and the beis kneses per se, but of Hashem, whose Shechinah rests there, and we must be cautious to treat them with holiness.
The Tzlach writes, "[Chazal teach] if someone has a beis medresh in his city and he doesn’t go there to daven he is considered a רע שכן, a bad neighbor. Even if there's a minyan in someone's house, it still doesn't compare to the holiness of a beis medresh, which is a מעט מקדש, where Hakadosh Baruch Hu resides. When a person is in a beis medresh, the yetzer hara is uprooted from his heart, and the atmosphere becomes similar to Eretz Yisrael. The tefillos go up to heaven... The sar (angel of chutz le'aretz) doesn’t have control over the atmosphere of a beis knesses. Whereas, when one davens at home, he forfeits all these benefits... We must be cautious with all matters that cause the Shechinah to leave the Jewish people — which was the Yevanim's goal. In galus, because of our many sins, the Shechinah doesn’t have a place to reside because the Beis HaMikdash was destroyed. But Hashem with His mercy, left us a remnant, as it says,ואהיה מעט למקדש להם (Yechezkel 11:16). These are the batei midrashim. The Shechinah resides there."
The Miracle of the Mizbeiach's Smoke
One of the miracles in the Beis HaMikdash was that the smoke from the mizbeiach rose in a straight line. The winds didn't scatter that pillar of smoke as it rose straight to heaven. As it states (Avos 5:5), את הרוח נצחה לא העשן עמוד the wind didn’t disperse the column of smoke that came forth from the mizbeiach.
The Avodas Yisrael writes, "The explanation is, the Beis HaMikdash of the earth is directly opposite the Beis HaMikdash in heaven. When the smoke of the mizbeiach rose to the Beis HaMikdash above, it was received with love by the Creator, bringing down bounty to all worlds. This couldn’t have occurred had the wind dispersed the pillar of smoke. Now behold.... Every beis medresh definitely has a corresponding beis medresh in heaven opposite it. The tefillos go up to the beis medresh in heaven. Therefore, one must be cautious never to speak in the beis medresh, other than words of tefillah, because when one speaks idle talk there, it’s like he is in the middle of conversing with the king and he says, 'I can't speak to you now' and then he speaks to others. This pushes away the Shechinah, chas veshalom. And also, it is possible that the tefillos of those who are davening in the beis medresh with kavanah will not be answered because of the sins of those speaking during the tefillah. Even worse is when one speaks during ץ"הש חזרת and התורה קריאת because kriyas haTorah is like Moshe Rabbeinu standing on Har Sinai, repeating the Torah from Hashem's mouth to the Jewish nation."