Many organisms have sex chromosomes with large non-recombining regions having expanded stepwise, the reason why being still poorly understood. Theories proposed so far rely on differences between sexes but are poorly supported by empirical data and cannot account for the stepwise suppression of recombination around sex chromosomes in organisms without sexual dimorphism. We show here, by mathematical modeling and stochastic simulations, that recombination suppression in sex chromosomes can evolve simply because it shelters recessive deleterious mutations, which are ubiquitous in genomes. The permanent heterozygosity of sex-determining alleles protects linked chromosomal inversions against expression of their recessive mutation load, leading to an accumulation of inversions around these loci, as observed in nature. We provide here a testable and widely applicable theory to explain the evolution of sex chromosomes and of supergenes in general.