The best honor for a dead Muslim who built a mosque is that he be remembered with supplication that Allah forgive him and accept his good deeds. That good act of his is enough honor as he earns everlasting rewards for it from the Almighty Allah.
Burying such a person in the mosque as is common in our land is an innovation. No text suggests that any grave attracts special mercy from Allah to its occupant on account of its closeness to the mosque. Worse still, it may invite people in the distant future to serious acts of associating partners with Allah (if not immediately); that is no honor to the dead.
نهى رسول الله صلى الله عليه وسلم أن يجصص القبر وأن يبنى عليه وأن يقعد عليه( وأن يكتب عليه). أبو داود
“The Prophet forbade that a grave be plastered or built upon or sat on” (by Abu Dawud).”
وقال صلى الله عليه وسلم :إن من شرار الناس من تدركه الساعة وهم أحياء ومن يتخذ القبور مساجد. رواه إبن خزيمة
He also said: “From the worst of people is the one who is alive when the Hour comes and the one who makes grave sites places of worship” (Ibnu Khuzaymah).
The scholars instruct that mosques built over graves be demolished, and the remains in graves built inside existing mosques be exhumed and buried elsewhere and it must not be in our houses because the Prophet also said:
وقال: لا تجعلوا بيوتكم مقابر. رواه الترمذي
“Do not turn your houses to burial grounds.” (by Attirmithee).
May Allah forgive our dead and grant them rest in death. Let us not dishonor them by our acts.
Written by: Sheikh Murtado Adedokun, Hafidhahullah.