Allah has cursed the Jews and Christians
A’isha (radi Allahu anha) said that the Prophet (sal Allahu alaihi wa sallam) said, “Allah has cursed the Jews and the Christians, (for) they took the graves of their Prophets as places of worship.”
[Sahih Al-Bukhari and Muslim]
A’isha (radi Allahu anha) continued to say, “He (sal Allahu alaihi wa sallam) was warning (the Muslims) against (doing) what they (the Jews and the Christians) had done.” And she (radi Allahu anha) also said: “Had it not been for that, the grave of the Prophet (sal Allahu alaihi wa sallam) would have been made prominent but he was afraid it might be taken (as a) place of worship.”
Umm Salamah and Umm Habeebah (radi Allahu anhum) told the Messenger of Allah (sal Allahu alaihi wa sallam) about a church that they had seen in the land of Abyssinia, and the images that were in it. He (sal Allahu alaihi wa sallam) said, “When a righteous man died among them, they would build a place of worship over his grave and put those images in it. They are the most evil of mankind before Allah.” [Sahih Al-Bukhari and Muslim]
There are many ahadith on this subject. The leading scholars of the Muslims, the imams of all four madhhabs (schools of Islamic law) and others, have stated that it is forbidden to build mosques (i.e. places of worship) over graves, and they have warned against that, following the Sunnah of the Messenger (sal Allahu alaihi wa sallam), sincerely advising his ummah and warning against falling into the same trap as those who came before us, the extremists among the Jews and Christians and their like among those of this ummah who have gone astray.
And Allah knows best!