Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:22:40

˹They are˺ those who have been evicted from their homes without right - only because they say, "Our Lord is Allah." And were it not that Allah checks the people, some by means of others, there would have been demolished monasteries, churches, synagogues, and mosques in which the name of Allah is much mentioned. And Allah will surely support those who support Him. Indeed, Allah is Powerful and Exalted in Might.  

they are, those who were expelled from their homes without right, for their expulsion; they were expelled, only because they said, that is, because of their saying: ‘Our Lord is God’, alone: such a saying is ‘right’, and so then to be expelled for ˹saying˺ it is to be expelled without right. Were it not for God’s causing some people (ba‘dahum, ‘some’, substitutes for al-nāsa, ‘people’) to drive back others, destruction would have befallen (read la-huddimat to emphasise a great number ˹of destructions˺; or read la-hudimat) the monasteries, (sawāmi‘) is for monks, and churches, (kanā’is) are for Christians, and synagogues, (salawāt) is the Hebrew term for Jewish houses of worship (kanā’is), and mosques, (masājid) are for Muslims, in which, that is, in which mentioned places, God’s Name is mentioned greatly, and with such destruction acts of worship cease. Assuredly God will help those who help Him, that is, ˹who˺ help His religion. God is truly Strong, overpowering His creation, Mighty, Invincible in terms of His dominion and power;
القرآن:٢٢:٤٠

الَّذِينَ أُخْرِجُوا مِنْ دِيَارِهِمْ بِغَيْرِ حَقٍّ إِلَّا أَنْ يَقُولُوا رَبُّنَا اللَّهُ ۗ وَلَوْلَا دَفْعُ اللَّهِ النَّاسَ بَعْضَهُمْ بِبَعْضٍ لَهُدِّمَتْ صَوَامِعُ وَبِيَعٌ وَصَلَوَاتٌ وَمَسَاجِدُ يُذْكَرُ فِيهَا اسْمُ اللَّهِ كَثِيرًا ۗ وَلَيَنْصُرَنَّ اللَّهُ مَنْ يَنْصُرُهُ ۗ إِنَّ اللَّهَ لَقَوِيٌّ عَزِيزٌ  

هم {الذين أخرجوا من ديارهم بغير حق} في الإخراج، ما أخرجوا {إلا أن يقولوا} أي بقولهم {ربنا الله} وحده وهذا القول حق فالإخراج به إخراج بغير حق {ولولا دفع الله الناس بعضهم} بدل بعض من الناس {ببعض لهدمت} بالتشديد للتكثير وبالتخفيف {صوامع} للرهبان {وبيع} كنائس للنصارى {وصلوات} كنائس لليهود بالعبرانية {ومساجد} للمسلمين {يذكر فيها} أي المواضع المذكورة {اسم الله كثيرا} وتنقطع العبادات بخرابها {ولينصرن الله من ينصره} أي ينصر دينه {إن الله لقويٌ} على خلقه {عزيز} منيع في سلطانه وقدرته.