A fetus develops as a female by default, but only begins developing as a male after six weeks, when hormones are released by the Y chromosome to inhibit the development of ovaries and cause them parts to develop into the testis and penis. By this time, however, the fetus has already developed nipples.
I mean, uh... because they're fun to bite on.