“Rav Chisda said: One may not destroy a beit knesset until another one is built” (Bava Batra 3b). After spending close to two double-sided pages discussing the building of fences, fences that separate neighbours, Rav Chisda discusses the building of shuls, which (hopefully) bring people together. While building a new shul is great, there must be no time gap between the destruction of the old and the building of the new.
The Gemara gives two reasons for this concern: “Some say because of negligence and some say because of prayer.” Despite the best of intentions, plans sometimes go awry and one might end up knocking down a shul and not building another one. This concern, Rav Ashi posits, remains even if monies have been collected and even if building materials have been purchased. Perhaps funds will be necessary for redeeming captives and the materials will need to be sold and it will not be possible to get further funds for construction of a synagogue. This speaks to both the importance of redeeming hostages and the prevalence of Jews being taken hostage: “the rabbis do not make decrees regarding something that does not happen often” (Bava Metzia 46b). We can live without a shul, but we dare not abandon a Jew taken captive.
The second approach of the Gemara is a more practical and immediate concern. If a shul is torn down before a replacement is built, where will Jews pray? Of course, if there are other shuls in the neighhborhood this concern would not apply, and one would be allowed to tear down the old shul even before the new one is built. Implicit in this view is the importance of davening in a shul itself. Even without a shul, one could daven in the town hall, a community centre, a courtyard or a large home. One could even, at least in the summer, daven outdoors something that was done in times of great communal need such as a drought (see Taanit, chapter 2).
Yet while we might be able to find a place to pray, the place to pray is in a beit Knesset. Some of our Sages went so far to declare that one may not daven even in a beit midrash, the study hall, and must go to the nearest beit knesset to daven. The Gemara records (at least according to the interpretation of Rabbeinu Gershom) that Mereimar and Mar Zutra maintained two shuls, a walled-in winter one and an airy summer one, ensuring that a shul was always available and comfortable. In the days before air conditioning and central heating, constructing a building with the elements in mind was most welcome.
The major codes of Jewish law only quote the first view, namely that we are afraid that if we don’t build before we tear down, we may never build. Shul or not, we need not worry that observant Jews will not pray. We do however need to worry that somehow a shul won’t get built. Whether people are slow to donate, few are willing to volunteer, or this excuse or that, there are myriad of reasons why the best of plans may not come to fruition.
 Actually building a shul may not always be a good thing. Rav Moshe Feinstein has a series of teshuvot where he forbids the building of new shuls when existing ones can serve the needs of the community. European communities enforced a ban on the opening of new shuls without the consent of the community leadership, something that helps explain the animosity towards chassidim who opened separate shteiblach to daven. For we who have grown up in the democratic west, the notion of needing permission to open a shul is most foreign and widely, but not necessarily wisely, ignored. See Meisheev Davar 1#46 where the Netziv gives a stinging rebuke to those who want to start a new shul for anything but the purest of motives.
 This can be tricky when doing a renovation. While in practice many a shul will daven in rented quarters in the interim, this may not be fully in keeping with this explanation of Rav Chisda; though with construction in full swing there may be little choice.
 There is a second girsa, version, of the text that reads, “another place for prayer.” If we accept this version – and many do - then as long as there is any place to daven, one can tear down an old shul before building a new one. The Taz, in his commentary to the Shulchan Aruch (Orach Chayim 152:1) claims that according to this version if there is another beit knesset in the area then even the first fear of “negligence” would not apply. The fear that another shul will never be built is only relevant, claims the Taz, if no shul exists in the area. If we accept his view, it would mitigate the problem mentioned in the previous footnote.