There’s actually a simple answer, anonymous: it’s a lot more energy efficient in the long run. Giving live birth is not only a far more exhausting process, but also, it consumes a lot of energy to nourish and protect a developing fetus. Doubly so because battling itself consumes a lot of energy as well. It’s simply easier and safer for both the mother and the young to lay eggs and allow the fetus to develop outside of the womb.