Halacha

הלכה א
כָּל מָקוֹם שֶׁיֵּשׁ בּוֹ עֲשָׂרָה מִיִּשְׂרָאֵל צָרִיךְ לְהָכִין לוֹ בַּיִת שֶׁיִּכָּנְסוּ בּוֹ לִתְפִלָּה בְּכָל עֵת תְּפִלָּה וּמָקוֹם זֶה נִקְרָא בֵּית הַכְּנֶסֶת. וְכוֹפִין בְּנֵי הָעִיר זֶה אֶת זֶה לִבְנוֹת לָהֶם בֵּית הַכְּנֶסֶת וְלִקְנוֹת לָהֶם סֵפֶר תּוֹרָה נְבִיאִים וּכְתוּבִים:
כסף משנה
1.
Wherever ten Jews live,1Since communal prayer is impossible without a quorum of ten, this is the minimum number of people that must live in a community before constructing a synagogue becomes obligatory. it is necessary to establish a place for them to congregate for prayer at the time of each prayer service.2Note Hilchot De'ot 4:23, which states that a Torah sage is not allowed to live in a city which lacks any of ten community resources, one of which is a synagogue.
This place is called a Beit K'nesset.3literally, "a house of congregation," generally, translated as "synagogue." The inhabitants of a city can compel each other4The Ramah (Choshen Mishpat 163:1) states that even if the majority of the inhabitants do not desire the construction of a synagogue, the minority have the right to compel them to build it. to construct5i.e., participate both financially and in the actual construction work, if necessary, a synagogue and to purchase scrolls containing the Torah, the Prophets, and the Sacred Writings.6so that these texts will be available for Torah study (Hilchot Sh'chenim 6:1). At present, when a greater number of Torah texts are available, the congregation is obligated to buy the Torah texts needed by the congregation - both adults and minors - for study (Magen Avraham 150:1).

הלכה ב
כְּשֶׁבּוֹנִין בֵּית הַכְּנֶסֶת אֵין בּוֹנִין אוֹתָהּ אֶלָּא בְּגָבְהָהּ שֶׁל עִיר שֶׁנֶּאֱמַר (משלי א כא) ״בְּרֹאשׁ הֹמִיּוֹת תִּקְרָא״. וּמַגְבִּיהִין אוֹתָהּ עַד שֶׁתְּהֵא גְּבוֹהָה מִכָּל חַצְרוֹת הָעִיר שֶׁנֶּאֱמַר (עזרא ט ט) ״וּלְרוֹמֵם אֶת בֵּית אֱלֹהֵינוּ״. וְאֵין פּוֹתְחִין פִּתְחֵי בֵּית הַכְּנֶסֶת אֶלָּא בַּמִּזְרָח שֶׁנֶּאֱמַר (במדבר ג לח) ״וְהַחֹנִים לִפְנֵי הַמִּשְׁכָּן קֵדְמָה״. וּבוֹנִין בּוֹ הֵיכָל שֶׁמַּנִּיחִין בּוֹ סֵפֶר תּוֹרָה. וּבוֹנִין הֵיכָל זֶה בָּרוּחַ שֶׁמִּתְפַּלְּלִין כְּנֶגְדּוֹ בְּאוֹתָהּ הָעִיר. כְּדֵי שֶׁיִּהְיוּ פְּנֵיהֶם אֶל מוּל הַהֵיכָל כְּשֶׁיַּעַמְדוּ לִתְפִלָּה:
כסף משנה
2.
When a synagogue is built, it should be built only at the highest point of the city [as implied by Proverbs 1:21]: "She cries at the head of the public places."1These statements are quoted from the Tosefta, Megillah 3:14. The commentaries question how this verse serves as a prooftext for the law which is stated. It should be built [so that] its height exceeds [that of] all the other buildings in the city [as implied by Ezra 9:9]: "to lift up the house of our God."
The2Shabbat 11a states: "Any city whose roofs are higher than the synagogue will ultimately be destroyed."
The Hagahot Maimoniot maintain that this applies only to buildings with flat roofs. However, if the roofs are slanted and therefore, will not be used by people, the height of the other buildings may exceed that of the synagogue. The Shulchan Aruch (Orach Chayim 150:2) states that apartments or offices in other buildings should also not be higher than the synagogue's roof.
The Mishnah Berurah 150:5 notes that many communities are not stringent in the observance of this law and quotes sources which explain that since buildings owned by gentiles are often taller than the synagogue, the synagogue is not likely to be the tallest building in the city in any case. Therefore, other Jewish houses may also be built higher than the synagogue. His own opinion, however, is not to seek leniency in this regard.
entrance to the synagogue should open only on the east [as implied by Numbers 3:38]: "...And those who camped before3The word "before" is understood to mean "at the entrance to." the sanctuary on the4This law is quoted from the Tosefta (loc. cit.). The Tur and Shulchan Aruch (Orach Chayim 150:5) explain that this law applied only in Babylon, where their synagogues faced west. Thus, the doorway on the eastern side would be opposite the ark. However, since the Rambam mentions the possibility of the heichal being built on different walls, but mentions only one position for the entrance, it appears that he requires the entrance to be placed at the east at all times. east."
In [the synagogue], a heichal, where the Torah scroll is placed, should be constructed.5This refers to a fixed structure like the ark (Aron HaKodesh) which is found in contemporary synagogues. In addition, as explained in the following halachah, the custom was to have a tevah, a smaller ark, positioned next to the place where the chazan would stand. The heichal should be constructed in the direction to which the people pray in that city,6As mentioned in Chapter 5, Halachah 3, one should always pray facing the direction of the Temple. Thus, if the synagogue is located to the west of Jerusalem, the heichal should be built into the eastern wall. so that they will face the heichal when they stand to pray.7It is apparent from the Rambam's statements that, if for some reason, the heichal of a synagogue was not positioned in the direction of Jerusalem, one should pray facing Jerusalem and not facing the heichal.

הלכה ג
וּמַעֲמִידִין בִּימָה בְּאֶמְצַע הַבַּיִת כְּדֵי שֶׁיַּעֲלֶה עָלֶיהָ הַקּוֹרֵא בַּתּוֹרָה אוֹ מִי אֲשֶׁר אוֹמֵר לָעָם דִּבְרֵי כִּבּוּשִׁין כְּדֵי שֶׁיִּשְׁמְעוּ כֻּלָּם. וּכְשֶׁמַּעֲמִידִין הַתֵּבָה שֶׁיֵּשׁ בָּהּ סֵפֶר תּוֹרָה מַעֲמִידִין אוֹתָהּ בָּאֶמְצַע וַאֲחוֹרֵי הַתֵּבָה כְּלַפֵּי הַהֵיכָל וּפָנֶיהָ כְּלַפֵּי הָעָם:
כסף משנה
3.
A platform is placed in the center of the hall,1both lengthwise and widthwise. (See the Jerusalem Talmud, Sukkah 5:1.) so that the one who reads the Torah2as described in the following chapter or one who gives a sermon3The Mishnah (Ta'anit 2:1) explains that on fast days, one of the elders of the congregation would speak and call the people to repent. Similarly, the Talmud mentions that some of the leading Sages would visit distant communities and address the people in the synagogue. can stand on it, so that all the others will hear him.4can stand on it, so that all the others will hear him.
When one positions the tevah which contains the Torah scroll,5In contrast to the heichal whose position is fixed, thetevah is a movable ark, in which the Torah scrolls used for the public reading of the Torah were kept. (See the responsa of the Radbaz, Vol. II, 157.) one should position it in the center of the hall,6widthwise in the direction of the heichal7i.e., close to the wall on which the heichal is constructed and facing the people.

הלכה ד
כֵּיצַד הָעָם יוֹשְׁבִין בְּבָתֵּי כְּנֵסִיּוֹת. הַזְּקֵנִים יוֹשְׁבִין וּפְנֵיהֶן כְּלַפֵּי הָעָם וַאֲחוֹרֵיהֶם כְּלַפֵּי הַהֵיכָל. וְכָל הָעָם יוֹשְׁבִין שׁוּרָה לִפְנֵי שׁוּרָה וּפְנֵי הַשּׁוּרָה לַאֲחוֹרֵי הַשּׁוּרָה שֶׁלְּפָנֶיהָ עַד שֶׁיִּהְיוּ פְּנֵי כָּל הָעָם כְּלַפֵּי הַקֹּדֶשׁ וּכְלַפֵּי הַזְּקֵנִים וּכְלַפֵּי הַתֵּבָה. וּבְעֵת שֶׁשְּׁלִיחַ צִבּוּר עוֹמֵד לִתְפִלָּה עוֹמֵד בָּאָרֶץ לִפְנֵי הַתֵּבָה וּפָנָיו לִפְנֵי הַקֹּדֶשׁ כִּשְׁאָר הָעָם:
כסף משנה
4.
How do the people sit in the synagogue? The elders sit facing the people with their backs toward the heichal. All the people sit row after row, each row facing the back of the row before it. Thus, all the people face the sanctuary,1the heichal the elders, and the tevah.2which should all be positioned in the direction of Jerusalem
When the leader of the congregation stands to pray, he stands on the ground - praying from a low place, as implied by Psalms 130:1: "From the depths, I called out to You, O God" (Berachot 10b).

When the leader of the congregation stands to pray, he stands on the ground, before the tevah,3Hence, the expression, 18ינפלáדרוי הביתה (literally, "descend before the ark") is often used to refer to leading communal prayer, because the chazan would pray "on the ground, before the tevah." facing the sanctuary4the heichal like the others.5i.e., facing the same direction as the other congregants.

הלכה ה
בָּתֵּי כְּנֵסִיּוֹת וּבָתֵּי מִדְרָשׁוֹת נוֹהֲגִין בָּהֶן כָּבוֹד וּמְכַבְּדִים אוֹתָן וּמַרְבִּיצִין אוֹתָן. וְנוֹהֲגִין כָּל יִשְׂרָאֵל בִּסְפָרַד וּבַמַּעֲרָב בְּשִׁנְעָר וּבְאֶרֶץ הַצְּבִי לְהַדְלִיק עֲשָׁשִׁיּוֹת בְּבָתֵּי כְּנֵסִיּוֹת וּלְהַצִּיעַ בְּקַרְקָעָן מַחְצְלָאוֹת כְּדֵי לֵישֵׁב עֲלֵיהֶם. וּבְעָרֵי אֱדוֹם יוֹשְׁבִין בָּהּ עַל הַכִּסְאוֹת:
כסף משנה
5.
Synagogues and houses of study should be treated with respect.1The Mishneh Berurah (151:1) notes that Megillah 29a quotes Ezekiel 11:16: "I have been a sanctuary in microcosm to them in the countries where they have come" to describe the synagogues in the Diaspora. This association allows one to infer that the obligation to honor a synagogue is related to the mitzvah (Sefer HaMitzvot, Positive Commandment 21) to revere the Temple.
The S'dei Chemed cites Sefer HaMitzvot (Negative Commandment 65) which mentions the prohibition against "destroying the houses where God is worshiped," indicating that the obligation to honor the synagogues has its source in a Torah commandment. (Note the commentary on Halachah 12.)
They should be swept clean2Sefer Chassidim 128 relates tht Rabbi Ya'akov bar Yakar, Rashi's teacher, would polish the floor before the ark with his beard. and mopped.3Their synagogues often had dirt floors. Thus, mopping them would also keep the dust from rising (Megillah 28b).
All the Jews in Spain, the west,4i.e., North Africa, Babylonia,5The translation is based on Targum Onkelos to Genesis 19:1. and Eretz Yisrael,6The term ארץ הצבי is applied to Eretz Yisrael, based on Jeremiah 3:19: "I will give you a delightful land (ארץ צבי), the finest heritage of a host of nations." (See also Daniel 8:9, Gittin 57a.) are accustomed to light lamps in the synagogue7The Rambam appears to imply that in addition to lighting lamps at night, when their light would be necessary, lamps were lit during the day as a mark of respect. and spread mats over the floor to sit on. In European communities,8literally, "in the cities of Edom (i.e., Rome)." they sit on chairs.

הלכה ו
בָּתֵּי כְּנֵסִיּוֹת וּבָתֵּי מִדְרָשׁוֹת אֵין נוֹהֲגִין בָּהֶן קַלּוּת רֹאשׁ כְּגוֹן שְׂחוֹק וְהִתּוּל וְשִׂיחָה בְּטֵלָה. וְאֵין אוֹכְלִין בָּהֶן וְאֵין שׁוֹתִין בָּהֶן וְאֵין נֵאוֹתִין בָּהֶן וְאֵין מְטַיְּלִין בָּהֶן וְאֵין נִכְנָסִין בָּהֶן בַּחַמָּה מִפְּנֵי הַחַמָּה וּבַגְּשָׁמִים מִפְּנֵי הַגְּשָׁמִים. וַחֲכָמִים וְתַלְמִידֵיהֶם מֻתָּרִין לֶאֱכל וְלִשְׁתּוֹת בָּהֶן מִדֹּחַק:
כסף משנה
6.
No lightheadedness - i.e., jests, frivolity, and idle conversation1cheapen the respect and awe one has for the synagogue. Rashi also includes in the category of קלות ראש all the other activities the Rambam mentions in this halachah because they all cause us to view the synagogue as a place where mundane affairs can be carried out, and thus, minimize our appreciation of its holiness. - should be seen in a synagogue.2The Sefer Mitzvot Gadol states that the sin of frivolity in the synagogues causes them to be sold to gentiles and transformed into houses of idol worship.
The Zohar (Parashat Vayakhel) severely condemns the sin of idle conversation in a synagogue, because God's presence is manifest there, and, therefore, any activity of this sort indicates a lack of reverence for Him.
We may not eat or drink inside [a synagogue],3Pesachim 101a relates that wayfarers would eat meals in the synagogue. However, Tosafot, Megillah 28a, explains that synagogues would have a side room that was used as a guest house. However, eating and drinking would not be permitted in the room used for prayer. nor use [a synagogue] for our benefit,4Our translation is based on the Rambam's Commentary on the Mishnah, Berachot 8:6. Rashi (Megillah 28b) renders ניאותין as "adorn ourselves." According to his interpretation, the synagogue should not be a place where people come to show off their clothes and jewelry. nor stroll inside one.5i.e., it is forbidden to go to a synagogue for the purpose of walking around to release tension (Kessef Mishneh).
On a sunny [day], one should not enter [a synagogue to seek shade] from the sun, and on a rainy [day], [one should not enter a synagogue to seek shelter] from the rain.6Megillah 28b relates that Ravina and Rav Ada bar Matanah were discussing a Halachic problem with Ravva outside. When it began raining, they entered a synagogue to continue their discussion. They explained, "We did not enter the synagogue because of the rain, but because the comprehension of the passage requires a relaxed state of mind." [However,] the sages and their students7The Magen Avraham 151:2 states that this license is granted only to scholars who spend the majority of their time in the house of study. Others, however, are not granted such privileges. are permitted to eat and drink in a synagogue8Megillah 28b states that a house of study is called "the rabbis' house," implying that they can do anything they would do in their own homes in the house of study. Since the holiness of a house of study exceeds that of a synagogue (see Halachah 14), we can assume that these activities are also permitted in a synagogue.
Nonetheless, this license is granted only...
because of the difficulty [observing the prohibition would cause them].9Forcing the scholars to leave the synagogue whenever they wanted to eat or drink would cause them to waste time that could be devoted to Torah study (Magen Avraham, loc. cit.:2).
The Magen Avraham cites authorities who permit wider use of synagogue facilities if they were originally constructed with this use in mind. This leniency is based on Megillah, loc. cit., which states that the synagogues in Babylonia could be used for mundane purposes since they were constructed with this condition in mind.

הלכה ז
וְאֵין מְחַשְּׁבִין בָּהֶן חֶשְׁבּוֹנוֹת אֶלָּא אִם כֵּן הָיוּ חֶשְׁבּוֹנוֹת שֶׁל מִצְוָה כְּגוֹן קֻפָּה שֶׁל צְדָקָה וּפִדְיוֹן שְׁבוּיִים וְכַיּוֹצֵא בָּהֶן. וְאֵין מַסְפִּידִין בָּהֶן אֶלָּא הֶסְפֵּד שֶׁל רַבִּים כְּגוֹן שֶׁיִּהְיֶה שָׁם הֶסְפֵּד גְּדוֹלֵי חַכְמֵי אוֹתָהּ הָעִיר שֶׁכָּל הָעָם מִתְקַבְּצִין וּבָאִין בִּגְלָלָן:
כסף משנה
7.
It is forbidden to calculate accounts in [a synagogue], unless the accounts are connected with a mitzvah:1See Ketubot 5a, which states that though it is forbidden to think over one's accounts on the Sabbath, one is permitted to calculate accounts that are associated with a mitzvah even in a synagogue. for example, the collection of charity,2For a more precise definition of the term קופה, see Hilchot Matnot Ani'im 9:1. the redemption of captives,3Note the Rambam's comments on the importance of the redemption of captives, Hilchot Matnot Ani'im 8:10-18.
or the like. [Similarly,] eulogies - This does not refer to a eulogy recited in the presence of the corpse itself, but rather a public meeting in honor of the deceased after his burial (Rav Kapach).
or the like.
[Similarly,] eulogies should not be recited inside them, except a eulogy that involves many [of the inhabitants of the city]; for example, [if] there were a eulogy of the great sages of that city for which all the people would gather together and come.4From Megillah 28b, it appears that this refers to a eulogy recited over a great sage, by a great sage, or attended by a great sage.

הלכה ח
הָיָה לְבֵית הַכְּנֶסֶת אוֹ לְבֵית הַמִּדְרָשׁ שְׁנֵי פְּתָחִין לֹא יַעֲשֶׂנּוּ קַפַּנְדַּרְיָא כְּדֵי שֶׁיִּכָּנֵס בְּפֶתַח זֶה וְיֵצֵא בַּפֶּתַח שֶׁכְּנֶגְדּוֹ לְקָרֵב הַדֶּרֶךְ. שֶׁאָסוּר לִכָּנֵס בָּהֶן אֶלָּא לִדְבַר מִצְוָה:
כסף משנה
8.
If a synagogue or a house of study has two entrances, one should not use it for a shortcut,1Note Hilchot Beit HaBechirah 7:2, which mentions a similar prohibition with regard to the Temple Mount. i.e., to enter through one entrance and leave through the other to reduce [the distance one] travels, because it is forbidden to enter [these buildings] except for a mitzvah.2Note Halachah 10, which states that if one enters a synagogue for the sake of a mitzvah, one may afterwards leave from the other entrance to shorten his way.
The Be'ur Halachah (151) questions whether a person who is going to do a mitzvah may take a shortcut through a synagogue. Though the Pri Megadim states that this might be permissible, the Be'ur Halachah maintains that the wording the Rambam chose implies that one must enter the synagogue to do a mitzvah within, and not to pass through for the sake of a mitzvah.

הלכה ט
מִי שֶׁצָּרִיךְ לִכָּנֵס לְבֵית הַכְּנֶסֶת לִקְרוֹת תִּינוֹק אוֹ חֲבֵרוֹ יִכָּנֵס וְיִקְרָא מְעַט אוֹ יֹאמַר שְׁמוּעָה וְאַחַר כָּךְ יִקְרָא חֲבֵרוֹ כְּדֵי שֶׁלֹּא יִכָּנֵס בִּשְׁבִיל חֲפָצָיו בִּלְבַד. וְאִם אֵינוֹ יוֹדֵעַ יֹאמַר לְתִינוֹק מִן הַתִּינוֹקוֹת קְרָא לִי הַפָּסוּק שֶׁאַתָּה קוֹרֵא בּוֹ. אוֹ יִשְׁהֶה מְעַט בְּבֵית הַכְּנֶסֶת וְאַחַר כָּךְ יֵצֵא. שֶׁהַיְשִׁיבָה שָׁם מֵעִסְקֵי הַמִּצְוֹת הִיא שֶׁנֶּאֱמַר (תהילים פד ה) ״אַשְׁרֵי יוֹשְׁבֵי בֵיתֶךָ״ וְגוֹ׳‎:
כסף משנה
9.
A person who has to enter a synagogue to call a child or his friend should enter and read [a portion of the written law] or relate a teaching [of the oral law] and then call his friend,1The Lechem Mishneh explains that the person should study first and then call his friend, so that it will not appear that he entered the synagogue only to serve his personal concerns. so that he will not have entered [a synagogue] for his personal reasons alone.2which is forbidden, as mentioned above.
If he does not know [how to study], he should ask one of the children3This suggestion is quoted from Megillah 28b, the source for this halachah. As obvious from Gittin 58a and other sources throughout the Talmud, synagogues were often used as classrooms for younger children. [to] tell him the verse he is studying4for listening to the words of Torah recited by another person is also considered as Torah study. or, [at the very least,] wait a while in the synagogue5The Ramah (Orach Chayim 151:8) states that one must wait at least the length of time it takes to walk eight handbreadths (slightly less than five feet). and then leave, since spending time [in the synagogue] is one of the aspects of the mitzvah as implied by [Psalms 84:5]: "Happy are those who dwell in Your house."6The Bayit Chadash (Orach Chayim 151) points out that the emphasis is not on sitting, but on spending time, whether one stands or sits. To clarify this point, the Rambam does not quote the Talmudic source (Megillah, loc. cit.) exactly. That passage reads, "[he should] wait a while, get up, and leave." The Rambam omits the expression, "get up," to indicate that one need not actually sit.

הלכה י
מִי שֶׁנִּכְנַס לְהִתְפַּלֵּל אוֹ לִקְרוֹת מֻתָּר לוֹ לָצֵאת בַּפֶּתַח שֶׁכְּנֶגְדּוֹ כְּדֵי לְקָרֵב אֶת הַדֶּרֶךְ. וּמֻתָּר לָאָדָם לִכָּנֵס לְבֵית הַכְּנֶסֶת בְּמַקְלוֹ בְּמִנְעָלוֹ וּבַאֲפֻנְדָּתוֹ וּבָאָבָק שֶׁעַל רַגְלָיו. וְאִם הָיָה צָרִיךְ לָרֹק יָרֹק בְּבֵית הַכְּנֶסֶת:
כסף משנה
10.
A person who enters [a synagogue] to pray or to study is permitted to leave by the opposite door to shorten his way.1Megillah 29a bases this law on Ezekiel 46:9 which states that in the Messianic age, after the people complete their service in the Temple, they will not leave through the same gate through which they entered. If this will be permitted in the Temple, it is surely permitted in a synagogue.2The Kessef Mishneh questions the order of the halachot chosen by the Rambam, noting that it would have seemed more logical to mention this law directly after Halachah 8, which forbids taking a shortcut through a synagogue. The Or Sameach points out a possible resolution of this difficulty, noting that in teaching this law after Halachah 9, the Rambam implies that leniency is granted only for the sake of calling a friend. However, it is forbidden to enter a synagogue and study Torah in order to leave by the opposite door.
A person is permitted to enter a synagogue3The Mishnah (Berachot 9:6) forbids the following four activities on the Temple Mount, considering them as irreverent. See also Hilchot Beit HaBechirah 7:2. [holding] his staff, [wearing] his shoes,4Though there is no obligation to remove one's shoes before entering a synagogue, we find the practice mentioned in various sources. The Jerusalem Talmud (Bava Metzia 2:8) relates that Rabbi Yehuda HaNasi's son removed his sandals before entering a synagogue. When he left, he discovered that they had been stolen. He said, "If I had not entered the synagogue, my sandals wouldn't have been stolen." wearing [only] lower garments,5In his commentary on the above mishnah, the Rambam defines אפונדתו as "a garment which one wears against his flesh to collect perspiration, so that... he will not spoil his dress clothing." Others render אפונדתו as "money-belt." or with dust on his feet.6Berachot 63a compares a synagogue to one's house. Since these activities are accepted in one's home, they are also acceptable in the synagogue.
It must be noted that many authoritative manuscripts of theMishneh Torah omit the phrases "wearing [only] lower garments" and "with dust on his feet." Note also the Shulchan Aruch (Orach Chayim 151:8) which states that a person should clean mud from his shoes before entering a synagogue.
If it is necessary for him to spit, he may spit in the synagogue.7Rabbenu Manoach cites the following statement from the Jerusalem Talmud (Berachot 3:5):
A person who spits in the synagogue is considered like one who spits in [God's] eye. Rabbi Yonah would spit and wipe it with his foot.
Rabbenu Manoach explains that this passage does not contradict the Babylonian Talmud (Berachot, loc. cit.) which allows one to spit in the synagogue. As long as Rabbi Yonah's practice is followed, there is no prohibition.
Though some authorities disagree, the Shulchan Aruch (Orach Chayim 151:7) accepts Rabbenu Manoach's decision. However, while reciting the Shemoneh Esreh, spitting is forbidden (Shulchan Aruch, Orach Chayim 97:2). The Magen Avraham 151:9 mentions that the Ari zal would refrain from spitting within a synagogue.

הלכה יא
בָּתֵּי כְּנֵסִיּוֹת וּבָתֵּי מִדְרָשׁוֹת שֶׁחָרְבוּ בִּקְדֻשָּׁתָן הֵן עוֹמְדוֹת שֶׁנֶּאֱמַר (ויקרא כו לא) ״וַהֲשִׁמּוֹתִי אֶת מִקְדְּשֵׁיכֶם״ אַף עַל פִּי שֶׁהֵן שׁוֹמְמִין בִּקְדֻשָּׁתָן הֵן עוֹמְדִין. וּכְשֵׁם שֶׁנּוֹהֲגִין בָּהֶן כָּבוֹד בְּיִשּׁוּבָן כָּךְ נוֹהֲגִין בָּהֶן בְּחֻרְבָּנָם חוּץ מִכִּבּוּד וְרִבּוּץ שֶׁאֵין מְכַבְּדִין אוֹתָן וְאֵין מַרְבִּיצִין אוֹתָן. עָלוּ בָּהֶן עֲשָׂבִים תּוֹלְשִׁין אוֹתָם וּמַנִּיחִין אוֹתָן בִּמְקוֹמָן כְּדֵי שֶׁיִּרְאוּ אוֹתָן הָעָם וְתֵעוֹר רוּחָם וְיִבְנוּם:
כסף משנה
11.
Synagogues and houses of study that have been destroyed remain holy [as can be inferred from Leviticus 26:31]: "I will destroy your sanctuaries."1The commentaries explain that since the verse states והשמותי את מקדשיכם, with the noun "sanctuaries" following the verb "I will destroy," rather than ואת מקדשיכם אשמים, one may draw the following inference. [Our Sages explained]: Even though they are destroyed, they remain2sanctuaries and therefore, must be regarded as holy.3Therefore,
Just as one must treat them with respect while they are standing,4as explained in Halachot 5-10. so must they be treated [with respect] when they are destroyed5Megillah 28b mentions that if one constructed a synagogue with the condition that it can be used for mundane purposes, one may do so. As mentioned in the commentary to Halachah 6, the Ramban and other authorities maintain that if a synagogue was constructed with such a condition, guests may eat inside and it may be used for other mundane purposes.
Tosafot disagrees, maintaining that the condition has no effect while the synagogue is standing and applies only after it has been destroyed. Thus, were a synagogue to be built with such a condition, as were the synagogues in Babylonia in Talmudic times, mundane activities could be carried on within its premises after it was destroyed. However, even then, activities directly opposed to the sanctity of the synagogue, e.g., sowing crops on the land, are forbidden.
The Shulchan Aruch (Orach Chayim 151:11) quotes Tosafot's opinion. Interestingly, the Rambam does not mention either the Ramban's or Tosafot's interpretation of the possibility of making the condition mentioned in Megillah (loc. cit.).
with the exception of sweeping and mopping them. [When destroyed], they need not be swept or mopped.6for there would be no benefit in doing so.
If grass grows in them, it should be pulled out and left there7The Mishnah (Megillah 28b) states, "If grass grow in it, it should not be pulled out." The Talmud comments that one is not allowed to pull out the grass to use as fodder for animals, but one may pull out the grass and leave it there.
In his Commentary to the Mishnah, the Rambam writes that one is permitted to pull the grass out and leave it in its place. The published text of the Mishneh Torah (which we have quoted) appears to imply that one should pull them out (i.e., it is imperative to do so). However, the version of the halachah found in authoritative manuscripts is closer to the understanding in the Commentary to the Mishnah.
The Shulchan Aruch (loc. cit.:10) quotes the version of the halachah in the published texts of the Mishneh Torah. However, the Mishnah Berurah (151:29) quotes the Commentary to the Mishnah.
so that it will be seen by the people [in the hope that] it will rouse their spirits and rebuild them.8In his Commentary to the Mishnah, the Rambam adds that if it is impossible for the synagogues to be rebuilt, the grass should be left there since seeing it will motivate the people to Teshuvah.

הלכה יב
אֵין סוֹתְרִין בֵּית הַכְּנֶסֶת כְּדֵי לִבְנוֹת אַחֵר בִּמְקוֹמוֹ אוֹ בְּמָקוֹם אַחֵר. אֲבָל בּוֹנִין אַחֵר וְאַחַר כָּךְ סוֹתְרִין זֶה. שֶׁמָּא יֶאֱרַע לָהֶם אֹנֶס וְלֹא יִבְנוּ. אֲפִלּוּ כֹּתֶל אֶחָד מִמֶּנּוּ בּוֹנֶה הֶחָדָשׁ בְּצַד הַיָּשָׁן וְאַחַר כָּךְ סוֹתֵר הַיָּשָׁן:
כסף משנה
12.
One should not tear down a synagogue in order to build another in its place or in another place.1Note Sefer HaMitzvot (negative commandment 65), which states that destroying a synagogue is a transgression of a Torah commandment. Nonetheless, if one's intention is to build a new synagogue, the destruction of the old one is permitted (See also Ramah, Orach Chayim 152:2). Instead, one should build the [new synagogue] and then, one [may] tear down the [previous] one2This law is quoted from Bava Batra 3b. Two reasons are mentioned by the Talmud. The Rambam quotes one: lest unforeseen difficulties arise [which prevent it] from being built.3The second reason mentioned in the Talmud is so that people will have a place to pray in the interim. The Talmud notes that different corollaries result from these two explanations. If there is another synagogue in the city, according to the second explanation (not mentioned by the Rambam), one could tear down the first synagogue while building a new one, since people would be able to pray in the other synagogue in the interim. However, according to the explanation quoted by the Rambam, it would be improper to destroy the synagogue lest the new synagogue never be built.
The Shulchan Aruch (Orach Chayim 152:1) quotes the Rambam's decision. The Mishnah Berurah 152:4 states that this law applies even if all the money necessary to build the new synagogue has been collected.

This applies even to a single wall of [a synagogue]. One should build the new wall next to the old wall and then, tear down the old wall.4The Be'ur Halachah (152) mentions the opinion of Rabbenu Asher who permits a community to enlarge a synagogue by tearing down an existing wall before building a new one if there is no other alternative. He maintains that the Rambam might also agree to this decision. However, most authorities interpret the Rambam's words as forbidding such a practice.

הלכה יג
בַּמֶּה דְּבָרִים אֲמוּרִים שֶׁלֹּא חָרְבוּ יְסוֹדוֹתָיו אוֹ שֶׁלֹּא נָטוּ כְּתָלָיו לִפּל. אֲבָל אִם חָרְבוּ יְסוֹדוֹתָיו אוֹ שֶׁנָּטוּ כְּתָלָיו לִפּל סוֹתְרִין אוֹתוֹ מִיָּד וּמַתְחִילִין לִבְנוֹת בִּמְהֵרָה בַּיּוֹם וּבַלַּיְלָה שֶׁמָּא תִּדְחֹק הַשָּׁעָה וְיִשָּׁאֵר חָרֵב:
כסף משנה
13.
When does the above apply? When its foundations are not ruined or its walls are not leaning perilously.1so that there is no danger in continuing to pray within. However, if its foundation is destroyed or its walls are leaning perilously,2and there is a danger that it may collapse it should be destroyed immediately3The Be'ur Halachah (152) states that this applies even if the community does not have another place to pray. and [then, efforts to] rebuild it should be begun immediately throughout the day and night lest times become difficult and it remain destroyed.4Bava Batra 3b relates that Rav Ashi saw a dangerous flaw in the synagogue of Mata Machsia. He ordered the building destroyed and then took his bed into the ruins to make sure that the community would rebuild it quickly. He did not remove his bed until the final fixtures of the building were completed.

הלכה יד
מֻתָּר לַעֲשׂוֹת בֵּית הַכְּנֶסֶת בֵּית הַמִּדְרָשׁ. אֲבָל בֵּית הַמִּדְרָשׁ אָסוּר לַעֲשׂוֹתוֹ בֵּית הַכְּנֶסֶת. שֶׁקְּדֻשַּׁת בֵּית הַמִּדְרָשׁ יְתֵרָה עַל קְדֻשַּׁת בֵּית הַכְּנֶסֶת וּמַעֲלִין בַּקֹּדֶשׁ וְלֹא מוֹרִידִין. וְכֵן בְּנֵי הָעִיר שֶׁמָּכְרוּ בֵּית הַכְּנֶסֶת יֵשׁ לָהֶן לִקַּח בְּדָמָיו תֵּבָה. מָכְרוּ תֵּבָה יֵשׁ לָהֶן לִקַּח בְּדָמֶיהָ מִטְפָּחוֹת אוֹ תִּיק לְסֵפֶר תּוֹרָה. מָכְרוּ מִטְפָּחוֹת אוֹ תִּיק לוֹקְחִים בְּדָמָיו חֻמָּשִׁים. מָכְרוּ חֻמָּשִׁין לוֹקְחִין בְּדָמָיו סֵפֶר תּוֹרָה. אֲבָל אִם מָכְרוּ סֵפֶר תּוֹרָה אֵין לוֹקְחִין בְּדָמָיו אֶלָּא סֵפֶר תּוֹרָה אַחֵר שֶׁאֵין שָׁם קְדֻשָּׁה לְמַעְלָה מִקְּדֻשַּׁת סֵפֶר תּוֹרָה. וְכֵן בְּמוֹתָרֶיהָ:
כסף משנה
14.
It is permitted to transform a synagogue into a house of study.1Megillah 27a describes a house of study as "a great house," "a house where Torah is developed." However, it is forbidden to transform a house of study into a synagogue because the sanctity of a house of study exceeds that of a synagogue2since Torah study takes precedence over the performance of all other mitzvot (See Hilchot Talmud Torah 3:3). See also Chapter 8, Halachah 3; Hilchot Talmud Torah 4:9. and one must proceed to a higher rung of holiness,3Our translation is based on the opinion of Rabbenu Nissim who maintains that it is forbidden to exchange a sacred article for another of an equal level of holiness. There are other opinions who maintain that it is permitted to do so. The Mishnah Berurah 153:11 states that even according to those opinions, the permission to do so is after the fact (בדיעבד), but not a priori. but not descend to a lower rung.4This principle applies in a number of different halachic contexts, for example, the practice of adding a new Chanukah candle each night (Shabbat 21a).
Similarly, the inhabitants of a city5Megillah 26b explains that this only applies to a synagogue in a village as explained in Halachah 16. who sold a synagogue6The Rambam's use of the past tense appears to imply that this is a only question בדיעבד. TheMishnah Berurah 153:3, however, presents as להתחילה (a priori), the possibility of selling an article of lesser sanctity in order to purchase an article of greater sanctity.
The sale of a synagogue is a complicated matter. See Halachot 16-20 and also the Shulchan Aruch, Orach Chayim 153:7 and commentaries.
may purchase an ark7See Halachah 3. with the proceeds.8The Lechem Mishneh emphasizes that a synagogue may only be sold for such a purchase if there is another synagogue in the city. If they sold an ark, they may purchase a mantle9In Ashkenazic communities, it is customary to hold a Torah scroll in a mantle. or a case10as is customary in Sephardic communities. Hilchot Sefer Torah 10:4 describes the sanctity of these ritual articles. for a Torah scroll with the proceeds. If they sold a mantle or a case, they may buy chumashim11In Talmudic times, the expression chumash referred to a scroll on which only one of the five books of Moses was written. Since it contained only one book, its holiness was on a lower level than that of a complete Torah scroll. with the proceeds. If they sold chumashim, they may buy a Torah scroll with the proceeds. If they sold a Torah scroll, the proceeds may only be used to purchase another Torah scroll,12There is a some difficulty with the Rambam's statements when compared to Hilchot Sefer Torah 10:2, where the Rambam writes:
It is forbidden for a person to sell a Torah scroll even if he has nothing to eat. [It is even forbidden] to sell an old scroll in order to purchase a new one. A Torah scroll should never be sold except for [one of] two purposes, so that one can use the money to study Torah or in order to marry.
Perhaps here the Rambam is speaking about a question that arose after the fact, once the Torah scroll has already been sold, while in Hilchot Sefer Torah, he is describing an a priori condition. Alternatively, he may be referring to circumstances where the new Torah scroll has already been written and all that is necessary is to pay for it. In such a case, one may sell an old Torah scroll (Rabbenu Manoach, Hilchot Sefer Torah).
for there is no level of holiness above that of a Torah scroll.13In Hilchot Sefer Torah (loc. cit.), the Rambam writes, "A kosher Torah scroll should be treated with special holiness and great honor."
The same [laws apply] to [any money] which remains.14i.e., if one sold many chumashim to purchase a Torah scroll and some of the proceeds from the sale remained, those monies should not be used to purchase anything on a lower level of holiness.

הלכה טו
וְכֵן אִם גָּבוּ הָעָם מָעוֹת לִבְנוֹת בֵּית הַמִּדְרָשׁ אוֹ לְבֵית הַכְּנֶסֶת אוֹ לִקְנוֹת תֵּבָה אוֹ מִטְפָּחוֹת וְתִיק אוֹ סֵפֶר תּוֹרָה וְרָצוּ לְשַׁנּוֹת כָּל מַה שֶּׁגָּבוּ. אֵין מְשַׁנִּין אוֹתָן אֶלָּא מִקְּדֻשָּׁה קַלָּה לִקְדֻשָּׁה חֲמוּרָה מִמֶּנָּה. אֲבָל אִם עֲשׂוּ מַה שֶּׁגָּבוּ לַעֲשׂוֹת וְהוֹתִירוּ מְשַׁנִּין הַמּוֹתָר לְכָל מַה שֶּׁיִּרְצוּ. וְכָל כְּלֵי בֵּית הַכְּנֶסֶת כְּבֵית הַכְּנֶסֶת. פָּרֹכֶת שֶׁעַל הָאָרוֹן שֶׁמַּנִּיחִים בּוֹ הַסְּפָרִים כְּמִטְפְּחוֹת הַסְּפָרִים. וְאִם הִתְנוּ עֲלֵיהֶם הֲרֵי הֵן כְּפִי הַתְּנַאי:
כסף משנה
15.
Similar [principles apply] if a congregation collected money to build a house of study or a synagogue or to purchase an ark, a mantle or a case [for a Torah scroll], or a Torah scroll, and desired to change [the purpose for which] all the [funds] had been [originally] collected.1Just as it is forbidden to sell sacred articles in order to purchase articles of lesser sanctity...
It is forbidden to change [the purpose for which the funds will be used]2Hilchot Matnot Aniyim 8:11 mentions an exception to this principle:
If the inhabitants of a city collected money for the construction of a synagogue and a matter involving a mitzvah arises, they may use the money for it. If they already bought stones and beams, they should not sell them for the sake of another mitzvah, except for the redemption of captives.
The Shulchan Aruch (Orach Chayim 153:6) states that a synagogue - and even a Torah scroll - may be sold for the purpose of supporting Torah studies or for other needs associated with mitzvot. Nevertheless, this measure should only be taken when there is no other way to cover these expenses (Mishnah Berurah 153:24). See also Siftei Cohen (Yoreh De'ah 252:1) which explains that one is only allowed to sell a synagogue for such purposes if the buyer will continue to have it used as a synagogue.
except from a matter of lesser sanctity to one of greater sanctity.3Rav Moshe Cohen questions the Rambam's decision, asking why it is forbidden to make a change of this nature. Even bricks intended for use in constructing a synagogue can be used for other purposes as long as they have not been actually built into the synagogue (See Megillah 26b).
The Turei Zahav (Orach Chayim 153:2) explains that money collected for the purchase of religious articles does not possess the sanctity of those articles. However, since the donors intended that the money be used to purchase religious articles, its use is constrained by the terms of an implicit vow that it be used for this purpose. Despite this limitation, the congregation may use these funds for another purpose associated with a mitzvah and substitute other funds to accomplish the purpose for which these funds were originally collected. (Note the Magen Avraham 153:5, who does not accept the latter conclusion.)
The Be'ur Halachah (153) supports the Turei Zahav's position based on Hilchot Beit HaBechirah 1:20, which states that a sacred utensil made with the intent that it be used in the Temple is not considered as "sacred" until it has actually been used for its intended purpose.
However, if [the congregation] accomplished the purpose for which they had [originally] collected [the funds],4e.g., they collected funds to purchase a Torah scroll and were able to purchase it for less money than they had collected. they may use the remainder for whatever they desire.5Megillah 27a mentions this leniency based on the principle that the money itself does not have the sanctity of the religious articles for whose purchase it was donated, but is merely designated to be used for their purchase.6Once the religious articles have been purchased, the Mishnah Berurah (153:14) states that these funds can be used for any purpose of benefit to the community, even if it has no association with a sacred article. However, there are authorities who require the money to be used to purchase an article which has some degree of sanctity.
All the components of a synagogue7e.g., the platform from which the Torah is read or its benches (Jerusalem Talmud, Megillah 3:1) are considered8to be on the same level of holiness like the synagogue itself.9and can only be sold for similar purposes.
Our Sages placed certain restrictions on the sale of the components of a synagogue. In Hilchot Matnot Ani'im 8:6, the Rambam writes:
If someone donates a light or a candle to a synagogue, it is forbidden to exchange it [for something else]. If [the sale] concerns a matter which is a mitzvah, it may be exchanged.... If the name of the donor has been forgotten, it is permitted to exchange [the object] even for a mundane matter.
In Hilchot Sefer Torah 10:4, the Rambam states that the platform "has no sanctity at all." However, this statement should be interpreted to mean that the platform is not considered a "sacred article" like the others mentioned in that halachah.
The curtain hanging before the ark10it is not clear whether the Rambam is referring to the tevah (the movable ark) or the heichal (the fixed ark). Rabbenu Nissim interprets the reference as to be to the tevah. is considered like the mantle of a Torah scroll.11since from time to time, it is placed under the Torah scroll (Megillah 26b). If a condition12allowing the use of the curtains for mundane purposes was made concerning them,13when they were originally purchased the terms of the condition are binding.14and there is no prohibition against using them for such purposes.

הלכה טז
בַּמֶּה דְּבָרִים אֲמוּרִים שֶׁמֻּתָּר לִמְכֹּר בֵּית הַכְּנֶסֶת, בְּבֵית הַכְּנֶסֶת שֶׁל כְּפָרִים שֶׁלֹּא עָשׂוּ אוֹתוֹ אֶלָּא עַל דַּעַת בְּנֵי הַכְּפָר לְבַדָּם שֶׁיִּהְיֶה לָהֶם לְהִתְפַּלֵּל בּוֹ שֶׁאִם רָצוּ כֻּלָּם לְמָכְרוֹ מֻתָּרִין. אֲבָל בֵּית הַכְּנֶסֶת שֶׁל כְּרַכִּין הוֹאִיל וְעַל דַּעַת כָּל אַנְשֵׁי הָעוֹלָם נַעֲשָׂה שֶׁיָּבוֹא וְיִתְפַּלֵּל בּוֹ כָּל הַבָּא אֶל הַמְּדִינָה נַעֲשָׂה שֶׁל כָּל יִשְׂרָאֵל וְאֵין מוֹכְרִין אוֹתוֹ לְעוֹלָם:
כסף משנה
16.
When do the above statements permitting the sale of a synagogue apply? In regard to a synagogue in a village. Since it was constructed for the sake of the inhabitants of that village alone,1even if the money for its construction was donated by people from outside the city (Ramah, Orach Chayim 153:7). so that they can pray inside it,2Based on this statement, the Mishnah Berurah 153:25 explains that the main determinant is not the size of the village, but whether the synagogue is also frequented by people from the outside. According to this understanding, a synagogue in a small village where large trade fairs are held is bound by the same laws as the synagogues of a large city. By the same token, a synagogue used by a private group of people in a large city may be comparable to a village synagogue. An example of such a case, cited by the Mishnah Berurah, is the custom once common that craftsmen of different professions would build synagogues for themselves. they are permitted to sell it if they all desire to do so.3The Ramban states that the consent of the majority of the village's inhabitants is sufficient. His opinion is accepted as halachah by the Mishnah Berurah 153:24.
In contrast, a synagogue in a metropolis, since it was constructed for the sake of all the people in the world, [i.e.,] so that anyone who comes to that country can come and pray in it,4For this reason, even if the money to build the synagogue was donated by the inhabitants of the city alone, they do not have the authority to sell the synagogue (Rabbenu Asher, Megillah 26a). it is considered as [the property] of [the entire] Jewish people and it can never be sold.5Halachah 19 mentions an exception to this principle. Also, the Magen Avraham 153:12 relates that if a synagogue in a city is no longer used for prayer, it may be sold. Based on this decision, the Rabbis (See Iggeret Moshe, Orach Chayim, Vol. I, 50) have permitted the sale of synagogues located in neighborhoods no longer inhabited by Jews.

הלכה יז
בְּנֵי הַכְּפָר שֶׁרָצוּ לִמְכֹּר בֵּית הַכְּנֶסֶת שֶׁלָּהֶן אוֹ לִבְנוֹת בְּדָמָיו בֵּית הַכְּנֶסֶת אַחֵר אוֹ לִקְנוֹת בְּדָמָיו תֵּבָה אוֹ סֵפֶר תּוֹרָה צְרִיכִין לְהַתְנוֹת עַל הַלּוֹקֵחַ שֶׁלֹּא לַעֲשׂוֹת אוֹתוֹ לֹא מֶרְחָץ וְלֹא בֻּרְסְקִי. וְהוּא הַמָּקוֹם שֶׁמְּעַבְּדִין בּוֹ אֶת הָעוֹרוֹת. וְלֹא בֵּית הַטְּבִילָה וְלֹא בֵּית הַמַּיִם. וְאִם הִתְנוּ שִׁבְעָה טוֹבֵי הָעִיר בְּמַעֲמַד אַנְשֵׁי הָעִיר בִּשְׁעַת מְכִירָה שֶׁיְּהֵא הַלּוֹקֵחַ מֻתָּר לַעֲשׂוֹת בּוֹ כָּל אֵלּוּ מֻתָּר:
כסף משנה
17.
The inhabitants of a village1See the previous Halachah. who desire to sell their synagogue in order to build another synagogue with the money, or to buy an ark or Torah scroll with the money,2in keeping with Halachah 15 must establish as a condition [of the sale] that the purchaser not use the building for a bathhouse, a leatherworks, a mikveh, or a laundry.3The translation of the Hebrew, בית המים, is based on Rashi's commentary to Megillah 27b. He also offers an alternate translation, "a latrine." The Kessef Mishneh favors the translation "laundry" since the prohibition against using the synagogue as a latrine is self-evident. Nevertheless, in his Shulchan Aruch (Orach Chayim 153:9), Rav Yosef Karo mentions a latrine, but not a laundry.
The sanctity of the synagogue is transferred to the money received from its sale and the building itself is no longer considered as "holy." Nonetheless, using the premises for such purposes is considered degrading.
As support for the prohibition against using premises that had previously served as a synagogue for such purposes, the Or Sameach cites II Chronicles 8:11: "I will not have a woman dwelling in the house of David... for the [places] where the ark of God has come are holy." Although the ark had already been placed in the Temple, it was not becoming to the ark for Pharaoh's daughter to be allowed to live in a place where it had been kept.

If, at the time of the sale, the seven officials of the community4In a responsum, the Rambam explains that there is no obligation to appoint seven officials to lead the community. Our Sages' use of that term merely implies that the governing communal body should not be a small group. Since the number seven is often used in the Bible, our sages employed it in this context.
In the same responsum, the Rambam defines the expression 18יבוט ריעה to mean "sages, men of Torah and good deeds, [people of whom it can be said] 'pleasant are the words spoken by those who fulfill them.'
made a condition in the presence of the entire community5The Ramah (Orach Chayim 153:7) states that a public announcement of the sale is sufficient for it to be considered as if all the inhabitants of the city were present. that the purchaser be allowed to use the building for the above purposes, he may.6Megillah 26a,b states that the restriction against selling a synagogue for an unbecoming purpose does not apply when the building was sold by the communal officials in the presence of the community. When it is sold in this manner, it can be "used even as a tavern."
The Meiri explains the rationale for this decision as follows: Even if an explicit statement was not made to the effect that the synagogue could be used for an unbecoming purpose, it is understood that the village's inhabitants consecrated the synagogue with the understanding that it be subject to the decisions of the community's officials. Therefore, they have the right to sell the synagogue for whatever purposes they wish.
The Ra'avad objects to the Rambam's decision and maintains that the license granted by Megillah (loc. cit.) only applies to the money received from the sale, while the building that was used as a synagogue can never be used for a purpose which is unbecoming. Though the Shulchan Aruch (loc. cit.) quotes the Rambam's view, the Be'ur Halachah suggests following the Ra'avad's decision, quoting the law (Shulchan Aruch, Orach Chayim 21:2), which forbids using a tallit for an unbecoming purpose even after its tzitzit have been removed.
Rav Moshe Feinstein (Responsa, Orach Chayim, Vol. II, 45) mentions this halachah in regard to the sale of synagogues in neighborhoods where Jews no longer live. Unfortunately, the natural clients for the purchase of an abandoned synagogue are churches. Rav Moshe states that selling a synagogue for use as a church is definitely forbidden. Using a synagogue for such purposes is more demeaning than using it for the purposes mentioned by the Talmud. He maintains that even according to the Rambam, selling a synagogue for this purpose could not be permitted.

הלכה יח
וְכֵן אִם הִתְנוּ שִׁבְעָה טוֹבֵי הָעִיר בְּמַעֲמַד אַנְשֵׁי הָעִיר עַל מוֹתַר הַדָּמִים שֶׁיִּהְיוּ חֻלִּין הֲרֵי הֵן חֻלִּין. וּכְשֶׁלּוֹקְחִין הַדָּמִים וּבוֹנִין מֵהֶן בֵּית הַכְּנֶסֶת אַחֵר אוֹ שֶׁיִּקְנוּ מֵהֶם תֵּבָה אוֹ מִטְפָּחוֹת וְתִיק אוֹ חֻמָּשִׁין אוֹ סֵפֶר תּוֹרָה הַשְּׁאָר יְהֵא חֻלִּין כְּמוֹ שֶׁהִתְנוּ וְיַעֲשׂוּ בָּהֶן מַה שֶּׁיִּרְצוּ:
כסף משנה
18.
Similarly, if the seven officials of the community made a condition in the presence of the entire community that [after the community accomplished the purpose for which they sold the synagogue], the remainder of the funds could be used for mundane purposes, they may be used for such purposes.1The Shulchan Aruch (Orach Chayim 153:7) accepts the opinion of Rashi, the Ra'avad, and Rabbenu Asher, who differ with the Rambam and maintain that the entire proceeds from the sale of a synagogue can be used for mundane purposes if the sale was carried out in the above manner.
In his Kessef Mishnah, Rav Yosef Karo explains the difference between these positions as follows. These authorities do not accept the Rambam's interpretation of Megillah 26a-b mentioned in the previous Halachah, and maintain that a certain measure of sanctity always remains in the synagogue. The Rambam maintains that the sanctity is transferred to the money received for the synagogue. Therefore, the condition made by the city officials can never effect the entire sum of money. Rather, the major portion must always be used for a sacred object.
[Interestingly, in his Kessef Mishnah, Rav Yosef Karo points out the advantages of the Rambam's position. However, in hisShulchan Aruch, he accepts the decisions of the other authorities.]
Thus, after the money has been used for building another synagogue, for purchasing an ark, a mantle or case [for a Torah scroll], chumashim, or a Torah scroll,2as mentioned in Halachah 14. the remainder may be used for mundane purposes in accordance with their condition, and may be used for whatever they please.3Megillah 27a describes such a situation and states that the remainder of the funds may be used even to hire a messenger for the city.

הלכה יט
וְכֵן אִם קִבְּלוּ עֲלֵיהֶן כָּל אַנְשֵׁי הָעִיר אוֹ רֻבָּם אָדָם אֶחָד. כָּל מַה שֶּׁעָשָׂה עָשׂוּי וְהוּא מוֹכֵר וְנוֹתֵן לְבַדּוֹ כְּפִי מַה שֶּׁיִּרְאֶה וְיַתְנֶה כְּפִי מַה שֶּׁיִּרְאֶה:
כסף משנה
19.
Similarly, if all the inhabitants of a city - or a majority of them1accept [the authority of] a single individual, - Note the Mishnah Berurah 153:35 which states that this applies only when the inhabitants of the city donated the money for the synagogue's construction themselves and accepted the authority of the person involved from the beginning of the synagogue's construction. - accept [the authority of] a single individual, whatever actions he takes [in regard to a synagogue] are binding.2Megillah 26a relates:
Rav Ashi said: "Even though people from all over the world come into the synagogue of Mata Machsia to pray, since the people donated the money for its construction subject to my decisions, allowing me to do what I want, I am permitted to sell it if I so desire."
He may sell [the synagogue] - as mentioned in the previous halachot
He may sell [the synagogue] or give [it as a gift]3as mentioned in the following Halachah. alone,4This expression appears to indicate that the sale may be conducted even without a public announcement as is required of the city officials in the previous halachot. Rabbenu Nissim (and the Shulchan Aruch, loc. cit.) disagree, stating that the sale must be made with the consent of the community. as he sees fit, and establish whatever conditions he desires.5in regard to the use of the premises or the proceeds from the sale.

הלכה כ
כְּשֵׁם שֶׁמֻּתָּר לָהֶם לִמְכֹּר בֵּית הַכְּנֶסֶת כָּךְ נוֹתְנִין אוֹתוֹ בְּמַתָּנָה. שֶׁאִלּוּ לֹא הָיָה לָהֶם לַצִּבּוּר הֲנָיָה בְּמַתָּנָה זוֹ לֹא נְתָנוּהוּ. אֲבָל לֹא מַשְׂכִּירִין אוֹתוֹ וְלֹא מְמַשְׁכְּנִין אוֹתוֹ. וְכֵן כְּשֶׁסּוֹתְרִין בָּתֵּי כְּנֵסִיּוֹת לִבְנוֹתָן מֻתָּרִין לִמְכֹּר וּלְהַחֲלִיף וְלָתֵת בְּמַתָּנָה הַלְּבֵנִים וְהָעֵצִים וְהֶעָפָר שֶׁלָּהֶן. אֲבָל לְהַלְווֹתָן אָסוּר שֶׁאֵין הַקְּדֻשָּׁה עוֹלָה מֵהֶן אֶלָּא בְּדָמִים אוֹ בַּהֲנָיָה שֶׁהִיא כְּדָמִים:
כסף משנה
20.
Just as it is permitted to sell a synagogue,1in a village, and afterwards, use the premises for mundane purposes it is permitted to give it away as a present.2to an individual to use as he sees fit. The Magen Avraham 153:26 states that the gift must be made by the community officials in the presence of the inhabitants of the village. However, the Pri Megadim does not require these conditions. Since the Rambam equates giving the synagogue as a present to a sale, it is not likely that he would make such limitations.
Megillah 26b states, "a gift is like a sale," because
If the community had not received any benefit from giving it as a gift, it would not have given it.3This principle is also reflected in questions of business law, e.g., Hilchot Gezeilah 9:9.
The Ritbah states that even when the community has not yet received any benefit from a person, it may give him a synagogue in the expectation of receiving such benefit.
However, it cannot be rented or given as security.4In the Talmudic era, when property was given as security, the person who received the property would have the right to use it throughout the term of the loan. [This practice raises questions in regard to the prohibition against taking interest. See Hilchot Malveh U'Loveh, Chapters 6 and 7.]
When a synagogue is sold, its sanctity is transferred to the money received for it and does not remain within the building itself. However, if a synagogue was rented or given as security, there is nothing to which the sanctity is transferred. Hence, it remains within the building and the person who rents it or receives it as security is forbidden to use it for his own purposes.
Note the Ramah (Orach Chayim 153:11) who states that the prohibition only applies when the person who receives the synagogue wants to use it for mundane purposes. If he continues to use it as a synagogue there is no difficulty.
Similarly, when a synagogue is being torn down so that it can be rebuilt, - Note Halachah 12 which states that the new synagogue must be built before the old one is torn down.

Similarly, when a synagogue is being torn down so that it can be rebuilt, it is permitted to sell the bricks, timber, and soil, exchange them,5even if the articles given in return are received later (Mishnah Berurah 153:68) or give them as gifts.6in return for benefit, as explained above. However, it is forbidden to lend them,7The Shulchan Aruch (Orach Chayim 153:11) states that this prohibition applies even when the loan is made by the community officials in the presence of the community.
Though the community officials have the power to nullify the sanctity of a synagogue as mentioned in Halachot 17 and 18, that provision only applies when they do so completely. In this instance, since the building materials have to be returned, their sanctity is not nullified. Hence, no one has the right to lend them to anyone for mundane use.
since their sanctity only departs in return for money or benefit which is equivalent to money.8Similar principles apply in regard to the redemption of other articles endowed with sanctity, e.g., Ma'aser Sheni (the second tithe) or articles dedicated to the Temple (הקדש).

הלכה כא
רְחוֹבָהּ שֶׁל עִיר אַף עַל פִּי שֶׁהָעָם מִתְפַּלְּלִין בּוֹ בְּתַעֲנִיּוֹת וּבְמַעֲמָדוֹת מִפְּנֵי שֶׁהַקִּבּוּץ רַב וְאֵין בָּתֵּי כְּנֵסִיּוֹת מְכִילִין אוֹתָן אֵין בּוֹ קְדֻשָּׁה מִפְּנֵי שֶׁהוּא עַרְאַי וְלֹא נִקְבַּע לִתְפִלָּה. וְכֵן בָּתִּים וַחֲצֵרוֹת שֶׁהָעָם מִתְקַבְּצִין בָּהֶם לִתְפִלָּה אֵין בָּהֶם קְדֻשָּׁה מִפְּנֵי שֶׁלֹּא קָבְעוּ אוֹתָם לִתְפִלָּה בִּלְבַד אֶלָּא עַרְאַי מִתְפַּלְּלִים בָּהֶן כְּאָדָם שֶׁמִּתְפַּלֵּל בְּתוֹךְ בֵּיתוֹ:
כסף משנה
21.
Although the people pray in a city's main street on fast days1Hilchot Ta'anit 4:1 states:
On each of the seven days of fasting for rain... the ark is taken out to the main street of the city and the entire populace gather together wearing sackcloth. Ashes are placed on the ark and the Torah scroll... and each person places [ashes] on his head.
and ma'amadot, - The mention of ma'amadot in this context in Megillah 26a (the source for this halachah), and here, in the Mishneh Torah, has raised questions. In Hilchot Klei HaMikdash 6:1-2, the Rambam describes the ma'amadot as follows:
The early prophets ordained that honest people who fear sin should be chosen to stand over the sacrifices. They are called anshei ma'amad. They were divided into 24 different watches....Each week, the anshei ma'amad of that watch would gather together. Those who lived in Jerusalem or close to it would come to the Temple.... Those who lived far away... would gather together in the synagogues of their locale.
In no source other than Megillah (loc. cit.) is it mentioned that the anshei ma'amad would pray in the street.
and ma'amadot, because too many people gather to fit within a synagogue,2Note Ta'anit 16a which states that the people would pray in the street as an expression of shame and embarrassment; alternatively, because leaving one's normal place of prayer is a form of exile which brings atonement. Interestingly, the Rambam ignores both these reasons and offers a reason which is not mentioned in previous sources. [the street] does not possess any quality of sanctity, because [praying there is only a temporary measure] and it is not established as a place of prayer.3[the street] does not possess any quality of sanctity, because [praying there is only a temporary measure] and it is not established as a place of prayer.
Similarly, buildings and courtyards where people gather to pray4even for communal prayer, e.g., a room in an office building where people gather for prayer. do not possess any measure of sanctity,5Thus, it is also permitted to perform mundane activities (those mentioned in Halachah 6) in these buildings. because they were not designated for prayer alone. Rather, [people] pray within them as a temporary measure, as a person prays within his home.6The Shulchan Aruch 153:8 mentions a situation in which a building is designated as a synagogue temporarily, for merely a limited period. During that time, it has the holiness of a synagogue. However, once it is no longer used as a synagogue, it has no holiness.

אהבה הלכות תפילה וברכת כהנים פרק יא
Ahavah Tefilah and Birkas Kohanim Chapter 11