Postcopulatory sexual selection is widely accepted to underlie the extraordinary diversification of sperm morphology. However, why does it favour longer sperm in some taxa but shorter in others? Two recent hypotheses addressing this discrepancy offered contradictory explanations. Under the sperm dilution hypothesis, selection via sperm density in the female reproductive tract favours more but smaller sperm in large, but the reverse in small, species. Conversely, the metabolic constraint hypothesis maintains that ejaculates respond positively to selection in small endothermic animals with high metabolic rates, whereas low metabolic rates constrain their evolution in large species. Here, we resolve this debate by capitalizing on the substantial variation in mammalian body size and reproductive physiology. Evolutionary responses shifted from sperm length to number with increasing mammalian body size, thus supporting the sperm dilution hypothesis. Our findings demonstrate that body-size-mediated trade-offs between sperm size and number can explain the extreme diversification in sperm phenotypes.