First, to paraphrase the Navy's stance -- Family planning is a personal decision.
When I was much more junior, I hated women who got pregnant just to get out of deployment or to get off of sea duty. Now? Now I have come to realize that most of those women were the ones I wanted to get rid of anyway. It's a typical Navy solution--send one's problems to someone else, and while I understand that unloading my problem sailor on a shore command isn't a nice thing to do, we're rather on the pointy end at sea. Every sailor counts. Sometimes they are more useful in absence than presence.
There's a saying that 20% of your people will take up 80% of your time--and anecdotally, that feels about right. Most of the women I've seen leave my ships due to pregnancy in the last ten years have definitely not been stellar sailors. They haven't normally been sailors I missed around the ship. They have had 'issues'. The amount of administrative time saved when those issues transfer almost makes up for the loss of the person who wasn't producing well anyway. I've personally only had one since I really started having leadership positions in 1998--and boy, howdy, was I happy to see the last of her fat, lazy backside.
On a side note? It's just as painful operationally to send a male sailor home to take care of his wife who is having complications as it is to send away a female sailor. I've had several of those.