I like the way St. Francis De Sales explained this verse.
This passage properly understood evidently shows that it was the custom of the primitive Church to watch, pray, fast, for the souls of the departed. For, firstly, in the Scriptures to be baptized is often taken for afflictions and penances ; as in S. Luke, chap xii., where Our Lord speaking of his Passion says: I have a baptism wherewith I am to be baptized and how am I straitened until it be accomplished!-and in S. Mark. chap x., he says : Can you drink of the chalice that I drink of; or be baptized with the baptism wherewith I am baptized? -in which places Our Lord calls pains and afflictions baptism. This then is the sense of that Scripture: if the dead rise not again, what is the use of mortifying and afflicting oneself, of praying and fasting for the dead?
First Corinthians 15 is a key chapter for Paul’s teaching on the resurrection of the body. He makes no statement on baptism for dead persons except to note that some unnamed “they” practice it. While the rest of his teaching in chapter fifteen refers to “we,” his Christian followers, “they” are not further identified. Who this group was may not be known with certitude today, but there are some reasonable interpretations:
Some commentators assume this verse refers to the practice of giving newly baptized children the names of deceased non-Christian relatives, with the hope that the dead might somehow share in the Lord’s mercy.
Another interpretation envisions the baptism of catechumens who have witnessed the persecution and martyrdom of their Christian predecessors. With their belief that the dead do rise, the Christian candidates come forward boldly and accept both the faith and its consequences.
A related view holds that the group consists of those baptized in connection with a dead Christian loved one. In the first century, many families were split religiously, as only one or two members may have converted to Christianity. When it came time for these new Christians to die, they no doubt exhorted their non-Christian family members to consider the Christian faith and to embrace it so that they could be together in the next world. After the deaths of their Christian loved ones, many family members no doubt did investigate the Christian faith and were baptized so that they could be reunited with their loved ones in the afterlife. At the time, many pagans had at best an unclear idea of what the afterlife was like, and there were a large number of sects promising immortality to those who were willing to undergo their initiation rituals. A pagan husband mourning the death of his Christian wife might thus have an unclear idea of what her religion was all about, but still have it fixed in his mind: “If I want to be with her again, I need to become a Christian, like she was, so I can go where Christians go in the afterlife.” This, then, could prompt him to investigate Christianity, learn its teachings about the afterlife and the resurrection, and embrace faith in Christ, receiving Christian baptism for the sake of being united with his dead loved one. The same is true, by extension, for other family relations as well, such as parents and children, grandparents and grandchildren. Even today deathbed exhortations to live the Christian life are not uncommon. People still resolve to live as Christians in order to please dead loved ones, to honor their memories, and to be united with them in the next life. The difference is that, today, most of those being exhorted have already been baptized.
Others advance the possibility that Paul was referring to the practice of a heretical cult that existed in Corinth. On this theory, Paul was not endorsing the practice of the group, but merely citing it to emphasize the importance of the resurrection. Rather, his point was: If even heterodox Christians have a practice that makes no sense if there is no resurrection of the dead, how much more, then, should we orthodox Catholics believe in and hope for the resurrection of the dead.
There is no other evidence in the Bible or in the early Church Fathers’ writings of baptism being practiced on the living in place of the dead.