Essentially, men have nipples because nipples are part of the basic human design option at conception. While modern societies may view nipples as secondary sexual organs, in reality a fetus of either sex develops nipples within a few weeks of conception. The human fetus actually develops several sets of nipples, much like other mammals, but only one set will fully mature in the womb. At this point in a fetus' development, there is no genetic difference between male or female. All fetuses develop nipples, chest muscles and milk glands.
The situation does not change until the chromosomes which determine sexual characteristics have the opportunity to affect development. This is the classic dividing line between females with the XX chromosome and males with the XY chromosome. While the nipples themselves may appear on both male and female fetuses, it is the introduction of hormones such as estrogen and testosterone which determine whether or not those nipples and breast tissues will function or not.
There are very few scientific conclusions concerning the original purpose or function of male nipples. Some human body parts, such as the wisdom teeth or appendix, did serve a real purpose for early human civilizations but have since become redundant or vestigial. There is little evidence, however, that men ever fed their young from their own lactating breasts.
While men have nipples, they generally do not develop the milk glands necessary for lactation. This is one of the functions suppressed by an influx of testosterone and a limited supply of estrogen in the male body. There are some reported incidents of men producing small amounts of breast milk as a result of a hormonal imbalance, but these cases are very rare.
Another question to consider about why men have nipples concerns the theory of evolution. Conventional wisdom suggests that any evolving species should eventually lose non-essential vestigial or redundant organs over time. Some experts suggest that human ancestors once possessed tails, for example, but modern humans have lost almost all traces of such an unnecessary body part.
If male nipples were truly redundant and served no real purpose, theoretically they should not exist in modern humans. Some scientists theorize that male nipples have not disappeared entirely because the body considers them to be relatively harmless. Male hormones naturally suppress any lactation or breast development, although male nipples and breasts are still vulnerable to cancer and other serious medical conditions.
The short answer to why men have nipples is because women have nipples. Male and female humans are virtually identical genetically except for a few sex-related chromosomes. The blueprints called genetic code create the same basic chassis for every fetus until the instructions for sexual development arrive. Based on the XX or XY chromosome information, the fetus will follow either the male or female template. A female will receive enough estrogen to trigger full development of breast tissue and milk glands, and her nipples will act as a conduit for a nursing baby. A male will not receive enough estrogen to activate his underdeveloped milk glands, therefore he will have nipples and some breast tissue, but will not be able to produce milk for his offspring.