Two men were mentioned to the Messenger of Allah ﷺ, one a devoted worshipper and the other a scholar. The Messenger of Allah ﷺ said, "The superiority of the scholar over the worshipper is like my superiority over the least of you."Then the Messenger of Allah ﷺ said, "Indeed, Allah, His angels, the inhabitants of the heavens and the earth, even the ant in its hole, and even the fish, all send blessings upon the one who teaches people what is good."
حدثنا محمد بن عبد الأعلى الصنعاني حدثنا سلمة بن رجاء حدثنا الوليد بن جميل حدثنا القاسم أبو عبد الرحمن
ذكر لرسول الله ﷺ رجلان أحدهما عابد والآخر عالم فقال رسول الله ﷺ فضل العالم على العابد كفضلي على أدناكم ثم قال رسول الله ﷺ إن الله وملائكته وأهل السموات والأرضين حتى النملة في جحرها وحتى الحوت ليصلون على معلم الناس الخير
Sourcing, [Its isnad is hasan]. Tabarani narrated it in Kabir, 8/278, no. 7911, from the hadith of Salama bin Raja with the same wording.Walid bin Jameel's hadith is hasan. See Tasheel al-Hajah, no. 3725. The report of Fudayl bin Iyad is sahih from him.