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:2:114

And who are more unjust than those who prevent the name of Allah from being mentioned in His mosques and strive toward their destruction. It is not for them to enter them except in fear. For them in this world is disgrace, and they will have in the Hereafter a great punishment.  

And who does greater evil — that is, none does more evil — than he who bars God’s places of worship, so that His Name be not invoked in them, in prayer and praise, and strives to ruin them?, through destruction and impeding people from them: this was revealed to inform of the Byzantines’ destruction of the Holy House ˹sc. Jerusalem˺, or ˹it was revealed˺ when the idolaters barred the Prophet (s) from entering Mecca in the year of the battle of Hudaybiyya; such men might never enter them, save in fear (illā khā’ifīna is a predicate, also functioning as a command, that is to say, ‘Frighten them by threats of waging war against them, so that not one of them shall enter it feeling secure’); for them in this world is degradation, debasement through being killed, taken captive and forced to pay the jizya; and in the Hereafter a mighty chastisement, namely, the Fire.
القرآن:٢:١١٤

وَمَنْ أَظْلَمُ مِمَّنْ مَنَعَ مَسَاجِدَ اللَّهِ أَنْ يُذْكَرَ فِيهَا اسْمُهُ وَسَعَىٰ فِي خَرَابِهَا ۚ أُولَٰئِكَ مَا كَانَ لَهُمْ أَنْ يَدْخُلُوهَا إِلَّا خَائِفِينَ ۚ لَهُمْ فِي الدُّنْيَا خِزْيٌ وَلَهُمْ فِي الْآخِرَةِ عَذَابٌ عَظِيمٌ  

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