Check the vents, can't remember exactly where there are. Normally either they're a small right angled rubber tube or can be just a hole, positioned either on the back or the bottom, some the main bulb holder is the vent, i.e. it not air tight. The big misconception is the headlight must be completely sealed, in fact it's the opposite. Water/condensation will get in due to either leaks or atmospheric conditions and heat either via the bulb/s or the outside temperature, condensation will be formed. It which case to stop fogging there must be a hole/vent.
Mostly and in my experience these fog due to a leak, the leak is nearly always due to the side light bulb holder Oring/seal failing, split etc. These are the 2 white twist out bulbs holders in the top corners, see attached pictures. The next mostly likely cause is the light unit being cracked It could also be the main bulb holder covers being torn/holed at the top, a split or tear at the bottom shouldn't give you a problem. I've seen many bikes with no main bulb holder covers at all they weren't suffering fogging, that only happens when the condensation can't get out. It's unlikely to be an issue with these covers, torn/holed or missing.
Don't be tempted to seal up the main bulb holder rubber covers.