Fordyce spots are a natural part of your anatomy. They’re present at birth, but they aren’t usually noticeable until puberty when hormonal changes enlarge them.
Fordyce spots usually don’t need treatment. But remedies are available if you want to remove the spots for cosmetic reasons.
It sounds like you have 2 different things - the Fordyce spots, which are normal and very common, and something happening on the head of your penis.
What did your doctor say about that? That sounds like a fungal infection, or perhaps eczema/dermatitis.
Are the white spots on your shaft, or around the head of your penis? If they are around the head, they might be pearly penile papules, which are also normal and common.