Megillah 3:2-3
Megillah 3:2
According to Rabbi Meir, a synagogue may only be sold on the condition that the sale may be reversed, though the Sages permit a shul to be sold permanently and unconditionally with four exceptions: it may not be sold for use as a bathhouse, as a tannery, for immersion or as a laundry. Rabbi Yehuda says that it may be sold for use as a courtyard, after which the purchasers may do as they please with it.
Megillah 3:3
Rabbi Yehuda also taught that eulogies may not be delivered in the ruins of a synagogue, nor may it be used to twist ropes or to spread nets, nor to spread fruit on the roof, nor for use as a short cut, as per Leviticus 26:31, “I will bring your sanctuaries into ruin,” from which we derive that they continue to be sanctuaries even when they are in ruins. If weeds grow in the ruins of a shul, they may not be plucked because seeing them causes us to grieve over the shul’s destruction.