Riding along with a funeral procession is disliked
It is narrated from Thawban (may Allah be pleased with him) that an animal was brought to the Messenger of Allah ﷺ while he was with a funeral procession:
فأبى أن يركبها فلما انصرف أتى بدابة فركب
“He ﷺ refused to ride it, but when he returned from the funeral and an animal was brought to him, he rode.” When he was asked about this, he said:
ان الملئكة كانت تمشى فلم أكن لأركب وهم يمشون فلما ذهبوا ركبت
“Indeed the angels were walking (with the funeral), so I could not ride while they were walking, but when they had left, I rode.”
➋ It is narrated from Jabir bin Samura (may Allah be pleased with him) that the Prophet ﷺ went on foot to the funeral of Ibn Dahdah (may Allah be pleased with him), and returned riding.
➌ The narration in which these words occur, that he ﷺ said:
ألا تستحيون أن ملائكة الله يمشون على أقدامهم وأنتم ركبان
“Are you not ashamed that the angels of Allah are walking on their feet while you are riding?” is da’if (weak).
Remember that permissibility together with dislike remains in any case, as has already passed in a narration earlier:
الراكب يسير خلف الجنازة
“The rider travels behind the funeral.”
(Albani, may Allah have mercy on him) Riding is permissible provided that one goes behind the funeral.