We build on previous observations that Hill–Robertson interference generates an advantage of sex that, in structured populations, can be large enough to explain the evolutionary maintenance of costly sex. We employed a gene network model that explicitly incorporates interactions between genes. Mutations in the gene networks have variable effects that depend on the genetic background in which they appear. Consequently, our simulations include two costs of sex—recombination and migration loads—that were missing from previous studies of the evolution of costly sex. Our results suggest a critical role for population structure that lies in its ability to align the long‐ and short‐term advantages of sex. We show that the addition of population structure favored the evolution of sex by disproportionately decreasing the equilibrium mean fitness of asexual populations, primarily by increasing the strength of Muller's Ratchet. Population structure also increased the ability of the short‐term advantage of sex to counter the primary limit to the evolution of sex in the gene network model—recombination load. On the other hand, highly structured populations experienced migration load in the form of Dobzhansky–Muller incompatibilities, decreasing the effective rate of migration between demes and, consequently, accelerating the accumulation of drift load in the sexual populations.