All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The Prophet, sallallaahu ‘alayhi wa sallam, stood for the funeral for three reasons. One was that he stood for the angels. However, it is not correct to restrict his standing to this reason only. Ibn Al-Qayyim stated these three reasons in his Revision of Abu Daawood's Sunan, saying:
"The Prophet, sallallaahu ‘alayhi wa sallam, had three reasons for standing for the funeral:
The first reason is that he [Prophet] said: "Indeed, death is alarmingly frightful." Imaam Muslim reported this as part of the Hadeeth narrated by Jaabir in which the Prophet, sallallaahu ‘alayhi wa sallam, said: "Indeed, death is alarmingly frightful, so if you see a funeral procession, stand up."
The second reason: The Prophet, sallallaahu ‘alayhi wa sallam, stood up for the angels. Anas narrated: "A funeral procession passed by us so the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, stood up. We said, 'Oh Messenger of Allaah, it is the funeral procession of a Jew.' He said, 'We stood up for the angels.'" [An-Nasaa’i]
The third reason: because it is a soul. Qays ibn Sa‘d and Sahl ibn Hunayf said: "A funeral procession passed by the Messenger of Allaah, sallallaahu ‘alayhi wa sallam, so he stood up. We said, 'It is the funeral procession of a Jew.' He, sallallaahu ‘alayhi wa sallam, said: 'Is it not a soul?'" [Al-Bukhari and Muslim]
The above are the three reasons confirmed about him, sallallaahu ‘alayhi wa sallam." [End of quote]
Allaah Knows best.