The temple endowment is an earthly ordinance. When a endowed person passes away the handbook says to dress them in their temple clothing. My question is why? If when we are resurrected our clothing, I would assume, is not resurrected with us why the temple clothing?
The thing to remember is that the endowment is not just for this life. The keys of the kingdom, combined with the sealing keys, ensure that whatsoever is recorded in earth is recorded in heaven. So while the saving ordinances must be performed in this world, they are not simply earthly ordinances.
To further understand this concept, consider the words of Brigham Young:
“Let me give you a definition in brief. Your endowment is, to receive all those ordinances in the house of the Lord, which are necessary for you, after you have departed this life, to enable you to walk back to the presence of the Father, passing the angels who stand as sentinels.” (Discourses of Brigham Young, selected by John A. Widtsoe, Salt Lake City: Deseret Book Co., 1941, page 416.)
If you are thinking that the endowment pertains only to matters of this world and this life, I would encourage you to visit the temple more often and ponder what is being shown.
Regarding the dressing of the dead in ceremonial robes, I asked a local temple president about it and received some great insights (whether through the spirit or his words, I give credit to both). I encourage you to do the same.