Answer:
For female animals, it is to feed their children ( like human babies ). For males, however, it is believed that it is because in the womb every animals starts off as a female ( The same as human babies ) and once given male parts the nipples don't really leave. ( Sorry if this doesn't make sense )