He greeted the Messenger of Allah ﷺ while he was performing ablution, but the Prophet ﷺ did not return the greeting until he had finished. Then he returned the greeting and said, "Nothing prevented me from returning your greeting except that I disliked mentioning Allah except in a state of purity."Because of this hadith, Hasan disliked reciting or mentioning Allah until he had purified himself.
حدثنا محمد بن جعفر قال سئل عن رجل يسلم عليه وهو غير متوضئ فقال ثنا سعيد عن قتادة عن الحسن عن الحضين أبي ساسان
أنه سلم على رسول الله ﷺ وهو يتوضأ فلم يرد عليه حتى توضأ فرد عليه وقال إنه لم يمنعني أن أرد عليك إلا أني كرهت أن أذكر الله إلا على طهارة قال فكان الحسن من أجل هذا الحديث يكره أن يقرأ أو يذكر الله عز وجل حتى يتطهر
Its chain of transmission is sahih. Hudayn is Ibn Munzir bin Harith Raqashi, Abu Sasan Kufi, a trustworthy narrator among the senior successors, whose hadith appears in Muslim. He was a companion of Ali and one of the commanders of his armies.The hadith was narrated by Abu Dawud, 1/90, no. 330, in the book of Purification, chapter on tayammum while in town, on the authority of Ibn Umar, and by Ibn Majah, 1/126, no. 350, in the book of Purification, chapter on a man being greeted while he is urinating.