The Bateman principle, which holds that oocytes are the limiting gamete in reproduction, is violated in a variety of species. Self-fertilizing hermaphrodites of the nematode Caenorhabditis elegans provide an example of a system in which sperm number limits lifetime reproductive output, in this species due to the protandrous nature of sperm production that in turn delays the onset of fertilization. This reproductive delay forms the basis of a trade-off between generation time and total fecundity, in which sperm number plays a pivotal role. I use an age-structured population model to describe the number of sperm that maximize fitness, given larval development time and rates of gamete production. The model predicts the evolution of sperm numbers that are consistent with empirical data for C. elegans provided that precocious larval sperm production is taken into account. Several testable hypotheses follow from the model regarding how natural selection and environmental variation may influence patterns of sperm production among populations or species with a similar mode of reproduction.