If the target creature is an illegal target by the time Fungal Infection tries to resolve, the spell doesn’t resolve. You won’t create a Saproling token.
The target creature will be on the battlefield when you create the Saproling token, even if it’s about to die for having 0 toughness or lethal damage. Its abilities may affect the token’s creation or trigger when the token enters the battlefield. Abilities that trigger this way will resolve after the target creature has died.