How did Alvin got in the celestial kingdom even though he was not yet baptized and did not have any wife at that time? How is this possible? Thanks!
Joseph’s oldest brother, Alvin, died in November of 1823, just months after Moroni visited Joseph for the first time. In that short time, Alvin supported Joseph, accepting his account of the angel at face value. Alvin particularly encouraged Joseph to get the gold plates and perform the work Moroni had for him. Their mother noted,
“Alvin had ever manifested a greater zeal and anxiety, if it were possible, than any of the rest with regard to the record which had been shown to Joseph, and he always showed the most intense interest concerning the matter. … [T]he moment Joseph spoke of the record it would immediately bring Alvin to our minds with all his kindness, his affection, his zeal, and piety.” (The History of Joseph Smith by His Mother, pg 119).
Perhaps the best example of this “zeal and anxiety” is the admonition he gave Joseph from his deathbed. “I want you to be a good boy and do everything that lies in your power to obtain the record. Be faithful in receiving instruction and in keeping every commandment that is given you.” (The History of Joseph Smith by His Mother, pg 116).
Despite Alvin’s good character, the Smith family was forced to face a popular but terrible doctrine: unbaptized and religiously unaffiliated, Alvin was damned.
“When Alvin died, the family asked a Presbyterian minister in Palmyra, New York, to officiate at his funeral. As Alvin had not been a member of the minister’s congregation, the clergyman asserted in his sermon that Alvin could not be saved. William Smith, Joseph’s younger brother, recalled: ‘[The minister] … intimated very strongly that [Alvin] had gone to hell, for Alvin was not a church member, but he was a good boy and my father did not like it.'” (“Teachings of the Presidents of the Church: Joseph Smith”, Redemption for the Dead).
As unpleasant as the sermon was, it accorded with what the Bible revealed about the legal requirements for heavenly entrance. But it did not square with the principle that God is just. Several years later, Joseph Smith found consolation through a revelation. In 1836, he saw in vision that Alvin would one day be in the Celestial Kingdom! This principle re-emphasized that God is just and merciful, thus “All who have died without a knowledge of this gospel, who would have received it if they had been permitted to tarry, shall be heirs of the celestial kingdom of God.” (D&C 137:7). As you note, Alvin had not been baptized, yet the Lord looked on his heart and saw he would have been had he lived just 6 1/2 more years (when the Church was reorganized). This revealed doctrine can provide tremendous levels of comfort, yet opens the doors to so many other questions: How essential is baptism if the Lord can just look at your heart and judge you? If it is still essential, then how is Alvin and others saved without it? Fortunately the Lord was not done speaking.
In 1840, Joseph Smith learned about baptism for the dead. This newly restored doctrine provided the mechanism to square the revelation on Alvin with God’s consistent teaching regarding baptism. Alvin qualifies for the celestial kingdom because he was penitent and exercised faith in Christ, and because he was baptized vicariously with Hyrum Smith standing as proxy.
You raise one more interesting question that sets us back to 1836. Alvin was single at the time of his death. Had he been married, he could have been vicariously sealed to his wife. But he was not, so he is in the same boat as so many of our single brothers and sisters who have died without the opportunity to be sealed to a companion. We have speculation on the mechanics of how this will be set right, but no firm revelation. In this case, we are comforted that God means it when He says, “I, the Lord, will judge all men according to their works, according to the desire of their hearts.” (D&C 137:9), and have faith that “He will yet reveal many great and important things” like the mechanism that sets this right.