In The Name of Allaah, The Most Merciful, The Bestower of Mercy
Allah [The Most High] said:
وَمَنْ أَظْلَمُ مِمَّن مَّنَعَ مَسَاجِدَ اللَّهِ أَن يُذْكَرَ فِيهَا اسْمُهُ وَسَعَىٰ فِي خَرَابِهَا أُولَٰئِكَ مَا كَانَ لَهُمْ أَن يَدْخُلُوهَا إِلَّا خَائِفِينَ لَهُمْ فِي الدُّنْيَا خِزْيٌ وَلَهُمْ فِي الْآخِرَةِ عَذَابٌ عَظِيمٌ
And who is more unjust than those who forbid that Allâh’s Name be glorified and mentioned much (i.e. prayers and invocations, etc.) in Allâh’s Mosques and strive for their ruin? It was not fitting that such should themselves enter them (Allâh’s Mosques) except in fear. For them there is disgrace in this world, and they will have a great torment in the Hereafter [Surah Al-Baqarah. Aayah 114]
Shaikh Uthaymeen [rahimahullaah] said:
And from the benefits of this verse is that it is permissible to remove a person from the mosque if there is a benefit, due to His statement: “that Allâh’s Name be glorified and mentioned much”;
Preventing someone from entering the mosques of Allah has requirements: sometimes the mosques are prevented [from being entered] so that its carpets, grounds, books or copies of the Qur’an are not degraded. Sometimes the doors are locked for fear of tribulation, such as in the case of a group of men congregating to stoke up trouble or [intending to] cause chaos, so they [i.e. the doors] may be closed to prevent them from congregating. Sometimes, they are closed for restoration or repairs. Sometimes, they may be closed for fear of theft. In all these cases, the closure [of a mosque] is permissible or desirable. [End of quote] [Ref 1]
Also in his explanation of Al-Arba’een An-Nawawiyyah, the Shaikh [rahimahullaah] narrated the incident regarding Imaam Maalik [rahimahullaah] and the man who asked him about the statement of Allaah -the Most High: [الرَّحْمَٰنُ عَلَى الْعَرْشِ اسْتَوَىٰ – The Most Beneficent (Allah) Istawaa (rose over) the (Mighty) Throne] [20: 5]; then the man said, ‘’How did Allaah rise [over the Throne]?’’ So he [Imaam Maalik] bowed his head [Rahimahullaah] – and began to sweat profusely due to the gravity of what had been put to him [i.e. the question] and the veneration [he had] for his Lord [The Mighty and Majestic]. Then he raised his head and said: “The Istawaa is not unknown”- Meaning: It is known in the Arabic language, [for example] one rose above something, meaning that he ascended over it. Everything that has been transmitted in the Qur’an and Sunnah and from the words of the [ancient] Arabs [indicates] that when [the word] Istawaa is followed by [the word] ‘alaa, it means ascension. And his [i.e. Imaam Maalik] statement: “And the how is not known”- Meaning, that we cannot comprehend how Allah ascended over the [Mighty] Throne with our [deficient] intellects, rather indeed it is only [known] by way of the [authentic] texts of the Sharee’ah. And his [i.e. Imaam Maalik] statement: “And to believe in it [i.e. Istawaa] is obligatory”; meaning that believing in the ascension of Allah over the [Mighty] Throne in a way that befits [His Majesty] is obligatory. “And asking about it is an innovation”, meaning that asking about the howness of the ascension is an innovation, because the companions – may Allah be pleased with them – did not ask the Prophet – [Sallal laahu alayhi wasallam] questions such as this and they are the most eager in knowing [about] Allah. The Prophet if asked knows Allah better than we do, yet the questions never occurred to them. So should not what sufficed them suffice us?
The answer: Of course, so it is obligated on a Muslim that he suffices with what the Salaf as-Saalih [pious predecessors] sufficed with and should not ask [about this].
Then Imam Malik [Rahimahullaah] said, “I do not see you” meaning, I do not think [you are] “except an innovator”, you wish to corrupt the people’s religion, then he ordered that he [i.e. the person who asked this question about the howness of the Istawaa] be removed from the mosque- the Prophets mosque [sallal laahu alayhi wasallam]. And he [i.e. Imaam Maalik] did not say, “By Allah, I cannot remove him, I fear that I may enter into Allaah’s statement: [وَمَنْ أَظْلَمُ مِمَّن مَّنَعَ مَسَاجِدَ اللَّهِ أَن يُذْكَرَ فِيهَا اسْمُهُ – And who is more unjust than those who forbid that Allâh’s Name be glorified and mentioned much (i.e. prayers and invocations, etc.) in Allâh’s Mosques] because I am preventing him from entering the mosque”. That is because he [i.e. that man] did not enter to glorify the name of Allah, rather he entered to corrupt the servants of Allah, and such a person should be prevented [from entering].
And when it is the case that the one who eats garlic and onions is prevented from entering the mosque, then how about the one who corrupts the religion of the people? Is he not more deserving to be prevented? Certainly, by Allah; but many of the people are heedless. [Ref 2]
[Ref 1: An Excerpt from ‘Tafseer Surah Al-Baqarah. Aayah 114’. slightly paraphrased]
[Ref 2]: [An Excerpt from ‘Sharh Al-Arba’een An-Nawawiyyah pages 37- 38.’ Slightly paraphrased]