This should be taken as a bit of a light hearted question (but not a Purim Torah by any means, I am looking for a real analysis), inspired by a discussion in chat.
Why is a woman allowed to get pregnant?
It causes harm to her (bleeding, tearing, etc.) and is certain to create a situation of Sakanas Nefashos even if all goes well, as clearly recognized in Halacha (actually especially if all goes well - as opposed to an early miscarriage).
So why is a woman allowed to go through that on purpose? Normally things that cause such danger would be forbidden, it would seem.
Of course the cop-out answer would be "well, life couldn't exist without it" but two points about that:
That is fine as an answer if it creates a principle that allows a broader applicability. If this is a one-off exception, that is really a cop-out.
Even if, that doesn't explain the Mitzvah MiDerabbanan to have more than two children (which is already a stretch to say that the Mitzvah of two children applies to the woman enough to waive the problem).
Can the Chachamim require you to put yourself in such danger for one of their Mitzvos as a precondition for the Mitzvah like that; by Chanuka, they don't (the Gemara in Shabbos says that in a time of danger, just light the candle on the table), but could they?