Islam is the religion of cleanliness. Allah Almighty says: (Truly Allah loves those who turn unto Him, and loves those who have a care for cleanness) (Al-Baqarah 2:222). The Prophet (peace and blessings be upon him) is reported to have said, “Cleanliness is half of faith.”
Your fast is valid as long as you have the intention to fast and it is permissible to delay ghusl until the time of fajr. In the case of ghusl following intercourse, it is recommended for the husband and wife to perform wudu’ before they sleep and to perform ghusl as soon as they can so that they can pray.
Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states: Your fast is considered valid as long as you had the intention to fast. Although you should wake up for sahur as there is great blessing in it, if you happened to wake up late and you did not bathe following impurity due to sexual relations or menses, your fast is considered as valid.
We are told in the authentic reports from `A’ishah, the Mother of the Believers and the beloved wife of the Prophet (may Allah be pleased with her) that the Prophet (peace and blessings be upon him) would wake up sometimes in a state of sexual impurity and yet would be fasting, but he would bathe prior to performing Fajr Prayer.