Understanding the origin of sex differences in lifespan and aging patterns remains a salient challenge in both biogerontology and evolutionary biology. Different factors have been studied but the potential influence of pathogens has never been investigated. Sex differences, especially in hormones and resource allocation, generate a differential response to pathogens and thereby shape sex differences in lifespan or aging. We provide an integrative framework linking host pathogenic environment with both sex-specific selections on immune performance and mortality trajectories. We propose future directions to fill existing knowledge gaps about mechanisms that link sex differences, not only to exposition and sensitivity to pathogens, but also to mortality patterns, whilst emphasizing the urgent need to consider the role of sex in medicine.