After the martyrdom of the great Prophet of Islam (pbuh&hp), Muslims disagreed in determining the place of his burial. Some people said that he should be buried in a mosque, some said: he must be buried along with his companions. At last, the commander of the faithful, Imam Ali (a.s) said: God has taken the Prophet's spirit in the purest area which is his room, so he deserves to be buried in the same room in which he passed away. The other people agreed with Imam Ali (a.s), then the pure body of the messenger of God was buried where he used to worship God Almighty.
source : erfan.ir