Why did females evolve to give birth and not also males?

I was researching about underwater sea creatures and seahorses caught my eye by their unique way of reproduction. With seahorses the female is the one to get the male pregnant instead of the typical way. How come seahorses are the only species that reverses the gender roles and every other species has it to where the female gets gives birth?