Do Mormons believe God planned the apostasy? And does the Mormon teaching of an apostasy mean God abandoned the Earth during that time?

In short, my opinion is No, and No.

First, to clarify the Mormon doctrine, we believe that sometime not too long after the deaths of the original apostles (like around 100-200 A.D.), God removed from the Earth the sacred authority which had been granted them ("removed", presumably in the sense that everyone who held the authority to lead the church died). Thereafter, no one had the authority to lead the Church of Christ. This authority is what Mormons call "priesthood". The authority, we believe, was restored to the Earth through Joseph Smith, in 1830, after which he restored the Church of Christ (now called the Church of Jesus Christ of Latter-day Saints, to distinguish it from the early church). The time in which the priesthood was not around was called the "apostasy" (or sometimes, the "great apostasy").

1. Let me tackle the first question first. There are perhaps two possible viewpoints based on the Mormon doctrine, (a) that God planned the apostasy, and (b) that God knew there would be an apostasy, and took steps to fix that later.

Those are two various viewpoints. I don't know necessarily how to distinguish between the two. In one sense, everything is planned. In another sense, very little is planned since men have their agency. In any case, my view is not that God wanted the great apostasy to happen, (it was the result of man's wickedness) but that he provided a relief from it in the form of Joseph Smith. (This is like my view on the Fall, expressed in another question, where I say I believe God planned *for* the Fall, but He did not necessarily *plan* the Fall.)

2. As far as the second question goes, the presence of an apostasy does not mean that God left all the people directionless during the centuries before Joseph Smith's restoration. One must differentiate between general apostasy and personal apostasy. As far as I know, the LDS church has never taught that the Holy Spirit was pulled off the earth, but rather that the *priesthood authority* was removed. Individuals certainly were able to feel the Spirit in their lives, and in that sense, many people certainly were working toward salvation.

In fact, I don't believe I've ever heard LDS leaders claim that the Holy Spirit was not felt at all during that time. Come to think about it, I have heard many church leaders talk about people like Columbus having been moved by the Holy Spirit (as is referred to in the Book of Mormon), as well as people like Martin Luther.