Anything that leads to idolatry in a Muslim country should not exist.
Unfortunately some ignorant Muslims go to dead graves and start praying to the dead. This is contrary to Islamic teachings.
“Beware of those who preceded you and used to take the graves of their prophets and righteous men as places of worship, but you must not take graves as mosques; I forbid you to do that.” (Sahih Muslim)
Sahih Muslim Book 4, Number 1083
Narrated Jundub ibn Abdullah (RAA) "I heard from the Apostle of Allah (SAW) five days before his death and he said: I stand acquitted before Allah that I took anyone of you as friend, for Allah has taken me as His friend, as he took Ibrahim as His friend. Had I taken any one of my Ummah as a friend, I would have taken AbuBakr as a friend. Beware of those who preceded you and used to take the graves of their prophets and righteous men as places of worship, but you must not take graves as mosques; I forbid you to do that.
Sahih Al-Bukhari Volume 1, Book 8, Hadith # 428
Narrated Abu Huraira (RAA) Rasulullah (SAW) said, "May Allah's curse be on the Jews for they built the places of worship at the graves of their Prophets."
Sahih Al-Bkhari Volume 1, Book 8, Hadith # 427
Narrated 'Aisha (RAA) and 'Abdullah bin 'Abbas (RAA) When the last moment of the life of Allah's Apostle (SAW) came he started putting his 'Khamisa' on his face and when he felt hot and short of breath he took it off his face and said, "May Allah curse the Jews and Christians for they built the places of worship at the graves of their Prophets." The Prophet (SAW) was warning (Muslims) of what those had done.
Sahih Al-Bukhair Volume 1, Book 8, Hadith # 419
Narrated 'Aisha (RAA) Um Habiba (RAA) and Um Salama (RAA) mentioned about a church they had seen in Ethiopia in which there were pictures. They told the Prophet (SAW) about it, on which he said, "If any religious man dies amongst those people they would build a place of worship at his grave and make these pictures in it. They will be the worst creature in the sight of Allah on the Day of Resurrection."
Sahih Muslim Book 4, Hadith # 2116
Narrated Jabir ibn Abdullah (RAA) Rasulullah (SAW) forbade that the graves should be plastered, or they be used as sitting places (for the people), or a building should be built over them. note: This hadith makes it very clear that we are NOT supposed to build ANYTHING over them. May Allah (swt) save us many of the Muslim today build strong plastered graves and this is against the order of Rasulullah (SAW)!
Sahih Muslim Book 4, Hadith # 2121
Narrated AbuMarthad al-Ghanawi (RAA) Allah's Messenger (SAW) said: Do not sit on the graves and do not pray facing towards them.
Worship is for God alone, not the creation. Anyone who worships animals, wood, stone, humans, animate or inanimate objects besides God is comitting shirk. Which in english translates roughly to partnership with God which is forbidden. Idolatry is just one form of 'shirk'.
Even in the bible it says, do not make a graven images or idols of God as there is nothing that resembles God.
The people in the muslim world who do this are sects that deviated from the original teachings of Islam. Such as sufis and shias.
The shias pray through their 'imams'. Which is shirk.
The sufis go through their 'saints', aka 'holy men'. These are all forbidden in Islam and contrary to the core teachings of Islam.
A dead person cannot help themselves, much less help someone else. These are pagan tendencies contrary to Islam and if any Muslims are doing this, they ought to be corrected.
A building is a building in the end.