Variation in female reproductive morphology may play a decisive role in reproductive isolation by affecting the relative fertilization success of alternative male phenotypes. Yet, knowledge of how environmental variation may influence the development of the female reproductive tract and thus alter the arena of postcopulatory sexual selection is limited. Yellow dung fly females possess either three or four sperm storage compartments, a polymorphism with documented influence on sperm precedence. We performed a quantitative genetics study including 12 populations reared at three developmental temperatures complemented by extensive field data to show that warm developmental temperatures increase the frequency of females with four compartments, revealing striking hidden genetic variation for the polymorphism. Systematic genetic differentiation in growth rate and spermathecal number along latitude, and phenotypic covariance between the traits across temperature treatments suggest that the genetic architecture underlying the polymorphism is shaped by selection on metabolic rate. Our findings illustrate how temperature can modulate the preconditions for sexual selection by differentially exposing novel variation in reproductive morphology. This implies that environmental change may substantially alter the dynamics of sexual selection. We further discuss how temperature-dependent developmental plasticity may have contributed to observed rapid evolutionary transitions in spermathecal morphology.