A couple of years ago, I posted my idea of diachronic hermaphrodites as an answer. In brief, an alien or fantasy species of sentient humanoids goes through up to five phases in life: presexual kids, gynosexual juniors, intersexual adults, androsexual matures and postsexual seniors. Procreation happens exclusively between juniors and matures, although sexual intercourse is also possible between members of other phases.
However, while I believe this could work well for a human-like species, I assume – without intervention of a higher being – it would only develop in a world where it’s the/a common sexual model. The actual evolution on Earth seems to suggest that sequential hermaphroditism is only beneficial in special cases, as it almost only happens in fish (and non-vertebrates). There, apparently, size plays a major role because older individuals grow large enough to either a) produce eggs which are much larger than sperm (protandry) or b) protect a harem (protogyny).
Which features should a world have to make this system the default for most land vertebrates, including mammals?