Shaykh Muhammad Nasiruddeen Al-Albaani said:
The grave and the Masjid do not exist together in Islaam, like one of the senior scholars mentioned, that combining a grave and a Masjid together invalidates Ikhlaas (sincerity) of Tawheed and the worship of Allaah – Tabaraka wa Ta’ala.
The Masajid were built to establish this Ikhlaas (Sincerity), like Allaah Ta’ala said [that which means in English]:
And the mosques are for Allaah (Alone), so invoke not anyone along with Allaah. [Jinn:18]
Tahdhir as-Sajid p.7