We are taught that planets (at least earth) have a spirit for they are as living creatures. What happen to the spirits of those planets that are destroyed and used as material for the birth of other planets?
Permit me a few moments to lay the foundation for your question. I agree with you that this earth that treats us so well is a living, spirit and element entity much like ourselves (although I continue to acknowledge that such references that lead me to this conclusion may just be prophetic poetry), so let’s move forward with that assumption (otherwise I’m afraid you’ll be quite disappointed in the answer). I have also heard that Joseph Smith taught that that this world was created through the destruction of others, but I don’t have such a quote sitting on my bookshelf. Nonetheless, let’s move on with the assumption that it is a true teaching (otherwise I’m afraid you’ll have a foreshortened answer). Finally, that leaves us with whether or not the other worlds sacrificed in creation are also living, spirit and earth entities. The principle laid out in Moses’ vision remains the standard form the revealed fate of outside worlds and kingdoms. “But only an account of this earth,” instructs the Lord, “… give I unto you” (Moses 1:35). So once again, we find ourselves in the dark concerning the veracity of your third assumption. Of course we’ll move forward with the assumption that other worlds, including comets and asteroids, have spirits as well.
Note that your question is meaningless if any of these three assumptions fail. If either the earth or other worlds are spiritless, then asking about their glorified states is akin to worrying about nuts and bolts losing their essences when assembled as part of an automaton. And if the earth was created independent of other worlds, then its resurrection will also be equally independent. Having laid a foundation, let’s build upon it.
I started by comparing the embodied earth with embodied persons. Perhaps this is for the best, as far more has been revealed about the divine destiny of man than the fate of the earth. With additional reflection, I find that the three assumptions apply us as well! I am an embodied spirit. My elements are composed of the elements that rightfully belong to other creatures – beef, poultry, fish, etc. And finally, we have the testimony of Joseph Smith that animals are capable of exaltation and are themselves embodied spirits. How is my body “restored to its proper frame” (Alma 11:43) when myriad resurrected animals have claim to the same elements?
I don’t know. This recycling of cells and nutrients is messy. A woman may exercise and eat healthy (fulfilling some temporal measures of her creation), and yet find herself stricken with cancer – communities of cells that openly fight their purpose. In the resurrection, the cells may perhaps be removed completely, or may be restored in a glorified, obedient state. Perhaps the elements of these wicked cells will find themselves restored to a telestial glory (greater than what they received on earth, but only distantly comparable to that of the celestial) on a telestial body to which they once belonged. The important thing is not how the resurrection works, but the simple fact that the resurrection is a sure event as evidenced by the Savior Himself. Witnesses ancient and modern have assured us of the tangible reality of this seeming impossibility.
Similarly, how the inhabited and uninhabited worlds receive glory in a fair and equitable manner is currently a matter of speculation. Perhaps the rocks themselves are inconsequential and the glory of the inhabitants is what determines the glory of the earth, with the wicked excised like a cancerous tumor. Perhaps the earth will not need the same quantity of elements as it does currently, leaving more to go around. The important thing is that we have been assured by a modern seer that the earth fills the measure of its creation and will be rewarded as a glorified creation.