Allah, the Qur’an is recited in them, beneficial classes are held, and worshippers devote themselves to iʿtikāf (spiritual retreat); these are the purposes of the mosques.
But if idols are erected there and worshipped besides Allah, such places are not mosques at all; they are shrines of polytheism—even though their people may call them mosques. “And the mosques belong to Allah,” meaning they belong to none but Him. Because mosques are the places where people gather and meet one another, they must be kept free of polytheism, innovations, and superstitions. People receive knowledge and perform acts of worship there, and if they encounter any element of shirk or superstition inside a mosque they will be influenced by it and disseminate it throughout the land. Therefore the mosques must be cleansed of every trace of shirk.
Foremost among them is the Sacred Mosque. Allah—majestic and exalted—commanded that it be purified, saying: “And [remember] when We settled Abraham at the site of the House [saying], ‘Do not associate anything with Me, and purify My House for those who walk around it, stand [in prayer], bow, and prostrate.’” [al-Hajj: 26]. Purify it from what? From polytheism, innovations, and superstitions, just as it is also cleansed of physical filth and impurities.
Concerning His words “do not invoke”: lā is the prohibitive particle, and tadʿū is a present-tense verb made jussive by this prohibitive lā; its jussive sign is the omission of the final nūn, for its original form is tadʿūna, and the prohibitive particle causes the nūn to be dropped.