The advantages of this system seem obvious especially where the individuals are solitary, distribution is patchy, or populations are spreading into new areas. In sea elephants, for example only the largest males are able to breed while the younger, smaller ones are completely without success and don't even try. The answer probably lies in the observation that all the species of fish that are known to change sex have simple reproductive systems and external fertilization. Mammals such as sea elephants, on the other hand, have the more complex reproductive systems necessary for internal fertilization, gestation, and lactation. The investment of time and energy needed to change sexes is probably too great under these circumstances and can be better spent in growing and learning the techniques needed to successfully defend a harem.
Sexual reproduction is a fascinating study for ethologists and the students of evolution.
Nobody knows how it arose in the first place, although there are many theories, and there is much discussion as to what its advantages might be. J.R. Krebs and N.B. Davies. Ltd. E.O. Wilson, Sociobiology. 1975 The Belknap Press of Harvard University.