If a person had a nocturnal emission while he was fasting, is his fast valid?
Yes, his fast is valid, because a nocturnal emission does not invalidate fasting. This is because it happens without a person choosing it, and the pen has been lifted from what happens while he is sleeping. But it is relevant here to draw attention to what many people do nowadays, which is to stay awake during the night hours of Ramadan and possibly stay awake doing something which does not benefit them, or something that is harmful to them. Then when daytime comes, they spend it sleeping, and this is not befitting. Indeed, what should be done is for a person to make his fasting time a time for performing acts of obedience, remembrance of Allaah, reciting the Qur’aan and other deeds that bring him closer to Allaah, the Most Blessed, the Most High.
Shaykh Muhammad bin Saalih al-`Uthaymeen
Fatawa Arkaanul-Islaam, DARUSSALAM, Vol.2, p.663