First of All Talo, who said people were worshipping the prophet, the prophet himself said when the pilgrims don't visit his grave they are being rude to him., and that if one visits the prophets grave it is the same as visiting him while he was alive.
It is a Sunnah to build tombs/shrines around the graves of Prophets (alaih salam) ,Salafs (RA) and Awliya al-Ikraam (rah). Although for public graveyards and ordinary muslims it is not allowed.
The First tomb in islam
Grave of Prophet Muhammad (Peace be upon him) is "INSIDE" room of the house of Ayesha (ra)
The Second tomb in islam
Grave of Sayyidna Abu Bakr (RA) is in a room of the house of Ayesha (ra) buried next to Prophet (Peace be upon him)
(and is their up till today)
The Third tomb in islam
Grave of Sayyidna Umar Ibnul Khattab (ra) is in a room of the house of Ayesha (ra) buried next to Prophet (Peace be upon him) and Abu Bakr (ra)
So it was a practice of Sahaba to bury Prophet (As) and Caliphs not openly but inside a Room or in other words a "CONSTRUCTED SHRINE"
Let me ask you a question, do you want to degrade our Holy messenger to the point his grave is just flat with nothing or anything to remember his message given to him by allah the exalted and wise?
Answering misquotation of Hadith and Objections(THIS IS A RESPONSE TO WHAT YOU HAVE POSTED)
Hadith states Sahih Muslim Volume 2, Book 23, Number 414
Narrated 'Urwa:
Aisha said, "The Prophet in his fatal illness said,
'Allah cursed the Jews and the Christians because they took the graves of their Prophets as places for praying."
Aisha (RA) added,
" Had it not been for that the grave of the Prophet (p.b.u.h) would have been made prominent but I am afraid it might be taken (as a) place for praying.
The above hadith is quoted for jews and christians not for muslims who took their Prophets as God, Son/daughter of God. Lets see how the classical scholars view it.
(What i just posted you above is how the modern day wahabi scholar views it)
Imam Ibn Hajar al - Haytami(in his Zawajir) quotes the hadith from Ahmad, Bukhari and Muslim that the Prophet (Allah bless him and give him peace) said:
"May Allah curse the Jews and Christians; they have taken the tombs of their prophets as places of worship."
He said, "The reason for considering it an enormity is obvious
He explains, however, that,
“Taking a grave as a place of worship means to pray on the grave or towards it.The prohibition, moreover, applies exclusively to the grave of someone venerated... under the two conditions:
A) that the grave is of someone who is honored and venerated;
B)
and that the prayer is performed towards or on the grave with the intention of gaining the blessing of it, or out of reverence for it.
(from: al-Zawajir, Reliance w21)
And this is only if one prays so close to it that if praying the prayer of those attentive (looking down), the grave would be within one's sight.
[end quote ]
Hence praying salat towards the grave or doing sajda infront of it as christians/jews used to do it is haram.No one is history of Islam took this hadith as proof of prohibiting building of tombs/shrines over Pious muslims graves.
Proof 1 of building of tombs around a grave
Quran states:
Thus did We make their case known to the people, that they might know that the promise of Allah is true, and that there can be no doubt about the Hour of Judgment. Behold, they dispute among themselves as to their affair. (Some) said, "Construct a building over them": Their Lord knows best about them: those who prevailed over their affair said,
"Let us surely build a place of worship over them."
Authentic classical Tafsir for this verse
Tafsir Number 1
Qadhi Thana Ullah Panipatti (Rahimuhullah) writes in his great Tafsir al Mazhari: After the death of Ashaab al Kahf a dispute occurred between Muslims and non-muslims,
The Muslims said that they will make a Masjid over them because they were of our faithwhereas the disbelievers said they will build other buildings on it where people will live….
This Ayah is proving that Mosques could be made near graves of Awliya in order to say salaat in them, Tabarruk is also attained through the tombs of Awliya [Tafsir al Mazhari Volume No.7, Page No. 123-124]
Tasfir Number 2
Tafsir by Imam Bayzawi (rah) says: "From this it is understood that to erect a Mausoleum for the special people, i.e. Pious Saints and Ulema, is permissible".
Tasfir Number 3
Tafsir by Imam Fakhrud'deen Razi (rah) writes:
أن بعضهم قال: الأولى أن يسد باب الكهف لئلا يدخل عليهم أحد ولا يقف على أحوالهم إنسان. وقال آخرون: بل الأولى أن يبني على باب الكهف مسجد وهذا القول يدل على أن أولئك الأقوام كانوا عارفين بالله معترفين بالعبادة والصلاة
[/b]Translation:
Some people said that the door of the cave should be closed so that nobody can enter it and the Ahwaal (of Ashab e Kahf) are kept hidden. Some people said that It is better to build a mosque at the door, this saying proves thatthese people were “ARIFEEN OF ALLAH WHO BELIEVED IN WORSHIPPING AND PRAYER” [Tafsir al Kabeer, Volume No. 5, Page No. 475]
Imam al-Razi also said:
ثم قال تعالى: {قَالَ ٱلَّذِينَ غَلَبُوا۴ عَلَىٰۤ أَمْرِهِمْ} قيل المراد به الملك المسلم، وقيل: أولياء أصحاب الكهف، وقيل: رؤساء البلد: {لَنَتَّخِذَنَّ عَلَيْهِم مَّسْجِدًا} نعبد الله فيه ونستبقي آثار أصحاب الكهف بسبب ذلك المسجد
Translation:And when Allah said {Those who prevailed over their affair} this refers to the“MUSLIM RULER” or the Awliya of Ashaab al Kahf (i.e. their momineen friends) or the leaders of town. {We will surely build a Mosque over them} so that we can “WORSHIP ALLAH” in it and due to it we will“PRESERVE THE RELICS OF ASHAAB AL KAHF” [Tafsir al-Kabeer, 5/475].
Proof 2
Hadrat Umar (Ra) wish to get buried beside Tomb of Prophet(saw) in a Room
Al-Bukhari narrates in his Sahih, Book of Jana'iz:
When `Umar was stabbed he sent his son `Abd Allah with a message to `A'isha to "Ask her if I can be buried with my two companions," that is, in her room,next to the Prophet and Abu Bakr. `A'isha replied: "I wanted the spot for myself, but I shall put him [`Umar] before me today." It had been her habit that if a man from among the Companions asked her that spot she would always refuse. She herself gave the following instructions before her death: "Bury me with my lady-friends (the wives of the Prophet in al-Baqi`) [but do not bury me with the Prophet in the house, for I dislike to be held in reverence (inni akrahu an uzakka)." Ibn `Umar came back with the news, whereupon `Umar said:"NOTHING IN THE WORLD WAS MORE IMPORTANT TO ME THAN THAT RESTING-PLACE."[Narrated by al-Bukhari in his Sahih.]
Why did Hadrat Umar (ra) wanted to get buried in a room and not outside , Why is Hadrat Abu Baker (Ra) buried in a Room , A tomb is also a room built around the grave ,and it proves its a sunnah
The Tomb of Aqah Karim (صلی اللہ علیھ وآلھ وسلم) is the greatest proof of this practice , Other tombs of Sahabas (Ra) were demolished by Al saud otherwise they too were present throughout history of islam.
It is also narrated that Mu`adh ibn Jabal (RA) and Bilal ibn Habashi (RA) came to the grave of the Prophet and sat weeping, and the latter rubbed his face against it.
► Ibn Majah 2:1320,
►Ahmad,
►al-Tabarani,
►al-Subki, and Ibn `Asakir
What did Prophet Muhammad (SAW) Mean when referring to the Christians and Jews?
This:

This is what is meant by building over graves, Muslims build shrines around not over the graves , This is how Shrine of our Prophet Muhammad (salehalawaalihiwasalam) is, And this is how all shrines are built.Wahabis (salafis) need to take English and Arabic lessons to understand the difference between Over and Around
answering Objection: Issue of building mosque over a grave
Dawud Book 20 Hadith 3230
Narrated Abdullah ibn Abbas:
The Apostle of Allah (peace_be_upon_him) cursed women who visit graves those who built mosques over them and erected lamps
This hadith can be explained by a simple logic that even Prophet Muhammad's grave is inside a mosque.Not in the main hall where Salat is offered but according to the most famous and respect Wahabi (salafi) historian Ibn khateer
Imam at-Tabari and Hafiz Ibn Kathir write, in 88 AH,
that the room of 'A'isha (may Allah be pleased with her) - where there are graves of the Prophet Muhammad (may Allah bless him and grant him peace), Abu Bakr and 'Umar (may Allah be pleased with them)- was joined to the mosque of the Prophet
[Tareeh Tabari and Tar'ikh Hafiz Ibn Kathir, Chapter of Government of Walid ibn 'abd al-Malik]
This does not only answers right from Sunnah point of view but also fully refutes the Wahabi claims , Ahlus sunnah doesn't believes in building mosques over a grave or graves inside mosques but attaches graves to the mosque and main prayer and salat hall is still sepeared from the mosque which is a sunnah practice.
May Allah guide us all, Ameen.