H.W.
The best suggestion I have is to let her know that you are sorry and that you care. Her emotions are ultimately going to be hers to work out. What you can do is not justify, not say 'well, it's in God's hands' or "it all worked out for the best" or anything which seems to attempt to make sense of it. Empathetic listening is the best advice I can give you at this time. (I've been on both sides of this situation.) At this point in time, she may be grieving and relieved and very conflicted. Validation of her feelings will be more well-received than analyzing the situation for her or trying to help her figure things out.
If she's the type who takes solace and comfort in books and reading, one book which really helped me was "Unspeakable Losses: Healing from Miscarriage, Abortion and other Pregnancy Losses" by Kim Kluger Bell. This book really does address the conflicted emotions which you mention. I found it to be a helpful book.
You obviously care a lot. Give her your love, a listening ear, and let her know you are there. That's all you can do.