Only mammals have mammaries and mammary glands.
What evolutionary factors determines the number of mammaries (nipples/teats/breasts) a species has?
Is it always an even number?
The number of mammary glands a species has is related to litter size. The relationship generally follows the "one-half rule," which states that the average litter size is equal to half the number of mammaries. The number of mammaries also tends to put an upper limit on litter size. It's not necessarily a hard limit, but survival tends to drop noticeably when number of offspring being nursed exceeds number of mammaries.
The number of mammaries is almost always even, but a notable exception is the Virginia possum, which has thirteen.
Gilbert, A.N. 1986. Mammary number and litter size in Rodentia: The "one-half rule". Proc. Natl. Acad. Sci. USA. Vol. 83, pp. 4828-4830.
As an addition to the excellent post by Erin.
As a name-giving key feature,mammals have mammary glands.
"Animals that are bilaterally symmetric have mirror symmetry in the sagittal plane", which includes Chordates such as mammals.
Some have seen this iconic picture, showing the bilateral symmetry in chordates:
It is easy to see why most commonly even number of mammary glands are found in mammals, given that they form in pairs, distal from the notochord.
Evolutionary, an uneven number of mammaries may be explained through a subjectively-mild mutation which may be retained as a vestigial-like feature, somewhat-functional or not.
On a molecular level, unilateral mammary glands likely involve key developmental pathways such as hedgehog and likely has underlying polygeneic root causes, - for the termination of gland formation on one side.
See this intersting paper:
Kohei Amakasu, Katsushi Suzuki, Hiroetsu Suzuki* "The Unilateral Urogenital Anomalies (UUA) Rat", Comp Med. 2009 June; 59(3): 249–256.
We established an inbred rat strain with unilateral urogenital anomalies from an incidentally identified male rat with unilateral renal agenesis and an undescended left testis. These rats were characterized by unilateral renal agenesis in both sexes, undescended testes with agenesis and hypoplasia of the accessory sex organs in male rats, and complete and partial agenesis of the uterine horn in female rats. All of these urogenital anomalies were unilateral and restricted to the left side; we named this phenotype unilateral urogenital anomalies (UUA). Breeding tests showed that these abnormalities were inherited as polygenic traits
It is noteworthy that the mammary glands in the male human population didn't decrease fitness to such a degree where evolutionary pressure would have lead to cease gland formation altogether, by adding extra information to the sex-chromosome(s). As such human males retain mammary glands, albeit typically never reaching a functional state.
The factors weighting against such additional genes are, that the default formation in most mammals is the female body plan, which conserves functional mammary glands to potentially feed their offspring, chipping away at the chance of genes involved in the cessation of mammary gland formation.
Secondly, selection pressure for information retained on the sex-chromosomes is higher, as opposed to autosomal (non-sex) genes. (See this nice concise post by Danielle Venton, The Degenerating Y Chromosome,Genome Biol Evol (2011) 3 1338-1339. )
Concluding, naturally, it would be easy for an asymmetric sponge to have an uneven number of protrusions or orifices, less so for humans, unless the orifice is located along an axis of symmetry.
Ad biological symmetry: