It is very difficult to give a definitive answer to your question as, ultimately, God is the only One who knows why these things have to happen. The Kabbalists try to explain a little the concept of a "need" for that soul to be in the world for as long as it is here, even if it never leaves the body. There is a more clinical and practical explanation that the world runs according to the laws of nature and, as such, God does not intervene in an open way, accordingly, there are many things that can go wrong from the time of conception until birth that might cause a spontaneous abortion and only on very rare occasions is the natural cycle going to be changed.