I read today in Doctrine and Covenants 138 that the gospel were preached to those who lived under Noah and rejected his message. So I suppose that it as well will be preached for those who reject the message today through Joseph Smith. Is it correct that those who rejected the prophets while living on the earth can be baptized by proxy and then enter the terrestrial world? Where did this doctrine come from and isn’t baptism the door to the celestial kingdom only?
It is true that baptism is the door to the celestial kingdom. However, baptism is the sign of a sacred covenant between the repentant believer and the Father. By keeping the baptismal covenant one is entitled to enter the celestial kingdom.
We read in Doctrine and Covenants Section 138 the following—
29 And as I wondered, my eyes were opened, and my understanding quickened, and I perceived that the Lord went not in person among the wicked and the disobedient who had rejected the truth, to teach them;
30 But behold, from among the righteous, he organized his forces and appointed messengers, clothed with power and authority, and commissioned them to go forth and carry the light of the gospel to them that were in darkness, even to all the spirits of men; and thus was the gospel preached to the dead.
So, in the post-mortal spirit world the gospel is preached to ALL the dead.
31 And the chosen messengers went forth to declare the acceptable day of the Lord and proclaim liberty to the captives who were bound, even unto all who would repent of their sins and receive the gospel.
So it is possible to repent in the post-mortal spirit world of sins committed while in the flesh–
32 Thus was the gospel preached to those who had died in their sins, without a knowledge of the truth, or in transgression, having rejected the prophets.
–including those who rejected the gospel while on earth.
33 These were taught faith in God, repentance from sin, vicarious baptism for the remission of sins, the gift of the Holy Ghost by the laying on of hands,
34 And all other principles of the gospel that were necessary for them to know in order to qualify themselves that they might be judged according to men in the flesh, but live according to God in the spirit (D&C 138:29-34)
Thus, if the post-mortal spirits, when hearing the gospel preached to them, have the necessary repentant change of heart into faithful, believing servants of the Lord Jesus Christ, they may qualify themselves for entrance into the celestial kingdom.
So apparently there is the opportunity to repent and work the works of righteousness up until the time of the resurrection. Then in the final judgement those who at that time are worthy of a celestial glory will be resurrected with a celestial body and will inhabit the celestial kingdom. Those who reject the Savior but live according to the principles of the law of Moses will be resurrected with a terrestrial body and will inherit a terrestrial glory. And whose who reject the teachings of the gospel and follow after the dictates of the adversary will be remanded to his custody until the end of the millennium. They will then be resurrected as telestial beings and will inherit a telestial glory.
So it is appropriate to perform vicarious baptisms for the dead, as well as all the other saving, exalting ordinances of the temple, in the hopes that the recipients will be believing and obedient, and thus qualify themselves for the blessings of God.