Sometimes when I wake up for fasting, I notice I had ejaculated (not the result of masturbation, but a wet dream). Despite that fact, I eat and drink completely, then I do ghusl in order to pray al-fajr. Given I ate while not pure, will this fast be accepted?
Inshaallah your fast will still be valid. The hadath (impurities) including farts, urinating, janabah, etc. are not the requirement for
doing starting the fast. Those are the requirement for other obligation such as the five prayer.
Allahualam - only Allah knows best