Why Worshipping Allaah At Graves Is Haraam
He (saw) warned against performing any form of worship near graves when he (saw) said, “Do not take graves as places of worship, for I forbid you from doing that.” [Saheeh Muslim] and “The most evil of people are those upon whom the Hour will come when they are still alive and those who take graves as places of worship.” [Bukhaaree & Ahmad]
So any act of worship is forbidden to be done near graves, even though it is directed towards Allaah (swt) (1).
The wisdom behind this is to close the door to shirk. It would have been easy for Shaytaan to fool those who worship near graves, into worshipping the dead buried in those graves – just as he deceived the people of Nooh into committing shirk by first convincing them to erect idols near their places of worship and then eventually causing the later generations to worship those idols.
Ibn Al-Qayyim said:
“There are several ways in which Shaytaan fooled the Mushrikeen onto idol worship. He played with every nation in accordance with their mind set and way of thinking.
He invited some people to idol worship through honouring the dead (2). These people sculptured idols in the shape of the righteous as had occurred with the people of Nooh.
This is why Allaah’s Messenger (saw) has cursed those who make masjids on graves and he forbade salaah at graves.”
[Igaathat Al-Afhaan, 2/222-223]
(1) So imagine the seriousness of the evil deed if the act of worship was directed to the person in the grave!
(2) See this post: The Origin Of Shirk: Venerating Graves