The drug prevents the kidneys reabsorbing glucose during the filtration of urine, which has the downside of feeding fungus often on the skin in small amounts but which can become an overgrowth.
The creams prescribed have an active antifungal, but I suspect that they also act as a physical barrier to the fungus.
As you have an infection now it needs treating but you could possibly reduce future risk by using baby wipes or lotions, as they are easily obtained, and might create a barrier to reinfection.