In 1 Shemuel 19:24, Shaul HaMelech is mentioned as taking off his clothes, laying naked, and prophesying. And the end of the passuk seems to indicate that prophesying naked was occasionally a trait of prophets. Doesnt Hashem's glory fill the entire world? How could he (and other nevi'im?) have nevua without clothes on?
It is true that just from reading the words in the pasuk, it appears that Shaul was unclothed, but if you look at the different mefoshim, most seem to say that he just "Stripped" himself of his royal garments, but in fact, had more simpler clothing on. So he wasn't unclothed. Some meforshim (on that pasuk) that I am referring to are the Mitzudas David, Perush Rabbeinu Yeshaya and Rashi.
Two meforshim that seem to agree to the straight translation of Shaul not being clothed, offer the explanation that, due to the prophecy, Shaul was in such a heightened state of mind that he no longer related to the mundane of being clothed or simply couldn't relate to it anymore. He was in an intellectual existence where bodily matters, like being clothed, was a foreign, irrelevant concept. The two meforshim (on that pasuk) are the Radak and Malbim.
As an aside, your question seems to be based on the halachah that one should not be undressed, even in private, for no reason as one is always in the presence of Hashem. If this is correct, that halachah is meant for you and me but Shaul was in a prophecy where basic halachah doesn't seem to always apply. See the first perek of Hosheya הושע as an example.