The following is taken from Daniel Tyler, "The Gospel Principles: Baptism for the Dead", Juvenile Instructor 13/13 (1 July 1878): 154-155.
Heretofore we have said but little about the dead. Not because they are of less importance than the living, but because our duties to ourselves when once understood include our duties to the dead. On this subject the whole world, outside of the Church of Jesus Christ of Latter-day Saints, are in darkness, although the ancient as well as modern scriptures are very plain.
The prophet Isaiah, in the 61st chapter and 1st verse, among other things, said of the mission of Christ, one portion of His labors would be "to proclaim liberty to the captives, and the opening of the prison to them that are bound."
To find the fulfillment of this prediction we must, of course, go to the New Testament, which gives His biography. Neither of the four writers of His life and travels tell us of His visiting a single prison to proclaim liberty to a single captive. But on the other hand they all tell us that He was Himself captivated, held a prisoner and put to death. But Peter, the presiding Apostle, unravels the mystery. In the 3rd chapter of his first epistle, commencing with the eighteenth verse, he says: "For Christ also hath once suffered for sins, the just for the unjust, that he might bring us to God, being put to death in the flesh, but quickened by the spirit: by which also he went and preached unto the spirits in prison; which sometime were disobedient, when once the longsuffering of God waited in the days of Noah, while the ark was a preparing, wherein few, that is, eight souls were saved by water."
The theory of some portion of the Christian world is that all who die in their sins must go to purgatory - a lake of fire and brimstone, to remain throughout all eternity. Peter tells us that those wicked antediluvians, after being shut up in prison a few hundred years to atone for their rebellion, have another chance offered them. He also tells us, in the 4th chapter and sixth verse of his first epistle, that the reason the gospel was preached to the dead was that they might be judged according to men in the flesh. Men in the flesh hear the gospel when it is on the earth, and the judgment where with they are judged is, if they receive and obey it they shall be saved, and if they reject it they shall be damned. So, then, the dead shall have the same chance. Our good fathers and mothers, grandfathers, grandmothers, uncles, aunts, and, in fact, all who have died without the gospel shall have the same chance as those who heard it in the flesh, that they may be judged the same as those who have their agency to receive or reject it, just as they please. But, says one, Jesus said they must be baptized as well as believe if they would be saved. Yes, and He said again, "Except a man be born of water and of the Spirit, he cannot enter into the kingdom of God."
A man means any man. Now, if no man can enter God's kingdom without baptism, how can the dead who receive the gospel be saved, as they cannot be baptized? Paul answers this question by asking another. In the first Corinthians, 15th chapter, 29th and 30th verses, he says: "Else what shall they do which are baptized for the dead, if the dead rise not at all? why are they then baptized for the dead? And why stand we in jeopardy every hour?"
This solves the mystery. Those who were not baptized because they did not hear the gospel, in fact all who have not committed the unpardonable sin, may at some period of God's mercy have the work done by proxy, and receive their resurrected bodies.
Baptism is of itself a sacrament, and reminds us that as Jesus died for us, and was buried and resurrected, so, also, shall we, through Him, come forth out of our graves, in like manner as we come out of the water. It is then an emblem, not only of His, but our own resurrection, through Him.