Why are monotremes so rare?
When you stop to think about it there is one big reason live birth has an advantage. Lets assume with habe organism A and organism B, A and B both have offspring of exactly the same size and needing the exact same amount of resources (nutrients, etc.) A lays and egg and B gives live birth. A needs to have all of the nutrients its offspring  will need all together at once because once it forms hte egg it cant add anything while organism B does not need it all, they can keep eating and supplying the nutrients over an extended period of time, as they gain it, so they need less "on hand" as it were. A and B may be putting the same amount of resources into their offspring but A does it all at once but B can spread it out over a long period of time meaning it does not need to build up huge reserves before breeding. As an added benefit if times are bad B can dump the offspring and try again later, saving all that would be wasted material for itself, so it can survive famine and drought better.