We present a model for the advantage of sexual reproduction in multicellular long-lived species in a world of structured resources in short supply. The model combines features of the Tangled Bank and the Red Queen hypothesis of sexual reproduction and is of broad applicability. The model is ecologically explicit with the dynamics of resources and consumers being modelled by differential equations. The life history of consumers is shaped by body mass-dependent rates as implemented in the metabolic theory of ecology. We find that over a broad range of parameters, sexual reproduction wins despite the two-fold cost of producing males, due to the advantage of producing offspring that can exploit underutilized resources. The advantage is largest when maturation and production of offspring set in before the resources of the parents become depleted, but not too early, due to the cost of producing males. The model thus leads to the dominance of sexual reproduction in multicellular animals living in complex environments, with resource availability being the most important factor affecting survival and reproduction.