The Messenger of Allah ﷺ saw a man bathing in an open space without a lower garment. He ascended the pulpit, praised Allah and extolled Him, then said ﷺ, "Indeed, Allah is Modest and Concealing. He loves modesty and concealment. So when one of you bathes, let him cover himself."
حدثنا عبد الله بن محمد بن نفيل حدثنا زهير عن عبد الملك بن أبي سليمان العرزمي عن عطاء
أن رسول الله ﷺ رأى رجلا يغتسل بالبراز بلا إزار فصعد المنبر فحمد الله وأثنى عليه ثم قال ﷺ إن الله عز وجل حيي ستير يحب الحياء والستر فإذا اغتسل أحدكم فليستتر
Sourcing, sahih. Nasai reported it in the book of ghusl, chapter on covering oneself during ghusl, hadith 406, from the hadith of Abdullah bin Muhammad bin Nufayl, transmitted through him. See also the following hadith.Between Ata and Yaala bin Umaya there is Safwan bin Yaala, as mentioned previously, hadith 1819.