Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:33:69

O you who have believed, be not like those who abused Moses; then Allah cleared him of what they said. And he, in the sight of Allah, was distinguished.  

O you who believe, do not behave, towards your Prophet, as did those who harmed Moses — when they would say, for example, ‘The only reason he does not wash with us is that he has an inflammation in his testicles’ — whereat God absolved him of what they alleged: when Moses placed his robe on a rock to go to wash, the rock hurtled away with it until it came to a halt amid a group of men from the Children of Israel. As Moses chased it and took his robe to cover himself, they saw that he had no such inflammation (udra is an inflammation of the testicle). And he was distinguished in God’s sight. An instance of our Prophet (s) being subjected to hurt was when ˹on one occasion˺ while dividing up the spoils a man said to him, ‘This is a division that I do not want to please God!’, whereat the Prophet (s) became angered and said, ‘May God have mercy upon Moses, for truly he was hurt with worse than this, but endured’ — reported by al-Bukhārī.
القرآن:٣٣:٦٩

يَا أَيُّهَا الَّذِينَ آمَنُوا لَا تَكُونُوا كَالَّذِينَ آذَوْا مُوسَىٰ فَبَرَّأَهُ اللَّهُ مِمَّا قَالُوا ۚ وَكَانَ عِنْدَ اللَّهِ وَجِيهًا  

(يا أيها الذين آمنوا لا تكونوا) مع نبيكم (كالذين آذوا موسى) بقولهم مثلا: ما يمنعه أن يغتسل معنا إلا أنه آذر (فبرأه الله مما قالوا) بأن وضع ثوبه على حجر ليغتسل ففر الحجر به حتى وقف بين ملأ من بني إسرائيل فأدركه موسى فأخذ ثوبه فاستتر به فرأوه ولا أدرة به وهي نفخة في الخصية (وكان عند الله وجيها) ذا جاه: ومما أوذي به نبينا ﷺ أنه قسم قسما فقال رجل هذه قسمة ما أريد بها وجه الله تعالى، فغضب النبي ﷺ من ذلك وقال: "يرحم الله موسى لقد أوذي بأكثر من هذا فصبر" رواه البخاري.

See similar narrations below:

Collected by Bukhārī
bukhari:4799Isḥāq b. Ibrāhīm > Rawḥ b. ʿUbādah > ʿAwf > al-Ḥasan And Muḥammad Wakhilās > Abū Hurayrah

Messenger of Allah ﷺ said, "Moses was a shy man, and that is what the Statement of Allah means: 'O you who believe Be not like those who annoyed Moses, but Allah proved his innocence of that which they alleged and he was honorable in Allah's Sight.' (33.69)  

البخاري:٤٧٩٩حَدَّثَنَا إِسْحَاقُ بْنُ إِبْرَاهِيمَ أَخْبَرَنَا رَوْحُ بْنُ عُبَادَةَ حَدَّثَنَا عَوْفٌ عَنِ الْحَسَنِ وَمُحَمَّدٍ وَخِلاَسٍ عَنْ أَبِي هُرَيْرَةَ ؓ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ إِنَّ مُوسَى كَانَ رَجُلاً حَيِيًّا وَذَلِكَ قَوْلُهُ تَعَالَى {يَا أَيُّهَا الَّذِينَ آمَنُوا لاَ تَكُونُوا كَالَّذِينَ آذَوْا مُوسَى فَبَرَّأَهُ اللَّهُ مِمَّا قَالُوا وَكَانَ عِنْدَ اللَّهِ وَجِيهًا}