Of the Most Unjust are Those Who prevent People from the Masjids and strive for their Ruin
The Quraysh idolators are those who hindered the people from the Masjids of Allah and wanted to destroy them. Ibn Jarir reported that Ibn Zayd said that Allah's statement,
وَمَنْ أَظْلَمُ مِمَّن مَّنَعَ مَسَـجِدَ اللَّهِ أَن يُذْكَرَ فِيهَا اسْمُهُ وَسَعَى فِى خَرَابِهَآ
(And who are more unjust than those who forbid that Allah's Name be mentioned (i.e. prayers and invocations) in Allah's Masjids and strive for their ruin) is about the Quraysh idolators who prevented the Prophet from entering Makkah from Al-Hudaybiyyah, until he slaughtered the Hadi (animal for sacrifice) at Dhi-Tuwa. He then agreed to a peace treaty with the idolators and said to them, (No one before has ever prevented people from entering the House. One would even see the killer of his father and brother, but would not prevent him (from entering the House of Allah).) They said, "Whoever killed our fathers at Badr, shall never enter it while there is one of us alive." Allah's statement,
وَسَعَى فِى خَرَابِهَآ
(and strive for their ruin) means those who prevent whoever maintain the Masjids with Allah's remembrance and who visit Allah's House to perform Hajj and `Umrah. Ibn Abi Hatim recorded that Ibn `Abbas said that the Quraysh prevented the Prophet from praying at the Ka`bah in Al-Masjid Al-Haram, so Allah revealed,
وَمَنْ أَظْلَمُ مِمَّن مَّنَعَ مَسَـجِدَ اللَّهِ أَن يُذْكَرَ فِيهَا اسْمُهُ
(And who are more unjust than those who forbid that Allah's Name be mentioned (i.e. prayers and invocations) in Allah's Masjids)"
After Allah chastised the Jews and Christians, He also criticized the idolators who expelled the Messenger of Allah ﷺ and his Companions from Makkah, preventing them from praying in Al-Masjid Al-Haram, which they kept exclusively for their idols and polytheism. Allah said,
وَمَا لَهُمْ أَلاَّ يُعَذِّبَهُمُ اللَّهُ وَهُمْ يَصُدُّونَ عَنِ الْمَسْجِدِ الْحَرَامِ وَمَا كَانُواْ أَوْلِيَآءَهُ إِنْ أَوْلِيَآؤُهُ إِلاَّ الْمُتَّقُونَ وَلَـكِنَّ أَكْثَرَهُمْ لاَ يَعْلَمُونَ
(And why should not Allah punish them while they hinder (men) from Al-Masjid Al-Haram, and they are not its guardians None can be its guardians except Al-Muttaqun (the pious), but most of them know not.) (8:34)
مَا كَانَ لِلْمُشْرِكِينَ أَن يَعْمُرُواْ مَسَاجِدَ الله شَـهِدِينَ عَلَى أَنفُسِهِم بِالْكُفْرِ أُوْلَـئِكَ حَبِطَتْ أَعْمَـلُهُمْ وَفِى النَّارِ هُمْ خَـلِدُونَ - إِنَّمَا يَعْمُرُ مَسَـجِدَ اللَّهِ مَنْ ءَامَنَ بِاللَّهِ وَالْيَوْمِ الاٌّخِرِ وَأَقَامَ الصَّلَوةَ وَءاتَى الزَّكَوةَ وَلَمْ يَخْشَ إِلاَّ اللَّهَ فَعَسَى أُوْلَـئِكَ أَن يَكُونُواْ مِنَ الْمُهْتَدِينَ
(It is not for the Mushrikin (polytheists), to maintain the Masjids of Allah while they witness against their own selves of disbelief. The works of such are in vain and in Fire shall they abide. The Masjids of Allah shall be maintained only by those who believe in Al…