Medical research reports that women often exhibit stronger immune responses than men, while pathogens tend to be more virulent in men. Current explanations cannot account for this pattern, creating an obstacle for our understanding of infectious-disease outcomes and the incidence of autoimmune diseases. We offer an alternative explanation that relies on a fundamental difference between the sexes: maternity and the opportunities it creates for transmission of pathogens from mother to child (vertical transmission). Our explanation relies on a mathematical model of the co-evolution of host immunocompetence and pathogen virulence. Here, we show that when there is sufficient vertical transmission co-evolution leads women to defend strongly against temperate pathogens and men to defend weakly against aggressive pathogens, in keeping with medical observations. From a more applied perspective, we argue that limiting vertical transmission of infections would alleviate the disproportionate incidence of autoimmune diseases in women over time.