You gave me the how, not the why. So I'll ask again: what is the purpose of men having a nipples and milk glands, albeit underdeveloped ones?
Also, we are male or female as soon as the DNA from the egg and sperm mix. It just doesn't become possible to determine until the 18-20 weeks of pregnancy.
I'm sure there is a good purpose Mother Nature has for men having them but that is over my head.
You are right about the DNA mix but, as I was saying, the formation of the genitals takes place at 3 - 4 months, the whole time the nipples are there for both genders.