The outcome of natural selection depends on the demographic processes of birth, death, and development. Here, we derive conditions for protected polymorphism in a population characterized by age- or stage-dependent demography with two sexes. We do so using a novel two-sex matrix population model including basic Mendelian genetics (one locus, two alleles, random mating). Selection may operate on survival, growth, or fertility, any or all of which may differ between the sexes. The model can therefore incorporate genes with arbitrary pleiotropic and sex-specific effects. Conditions for protected polymorphism are expressed in terms of the eigenvalues of the linearization of the model at the homozygote boundary equilibria. We show that in the absence of sexual dimorphism, polymorphism requires heterozygote superiority in the genotypic population growth rate. In the presence of sexual dimorphism, however, heterozygote superiority is not required; an inferior heterozygote may invade, reducing the population growth rate and even leading to extinction (so-called evolutionary suicide). Our model makes no assumptions about separation of time scales between ecological and evolutionary processes, and can thus be used to project sex×stage×genotype dynamics of eco-evolutionary processes. Empirical evidence that sexual dimorphism affects extinction risk is growing, yet sex differences are often ignored in evolutionary demography and in eco-evolutionary models. Our analysis highlights the importance of sexual dimorphism and suggests mechanisms by which an allele can be favored by selection, yet drive a population to extinction, as a result of the structure and interdependence of sex- and stage-specific processes.