This is just one example of how many times we need to be baptized. Paul actually admonishes the Corinthians to stop practicing the pagan ritual of baptisms for the dead in his first epistle to them. (1 Corinthians 15:29) The people of Corinth were being baptized for everyone, dead or alive.
Strangely enough, they didn’t believe in the resurrection and that is where Paul comes in with his admonition. Why are you being baptized for dead people when you don’t believe they’ll rise from the dead anyway?
Baptism is a statement to the world that you are a follower of Jesus. Jesus gave us two ordinances to observe; baptism and partaking in communion. In obedience you are doing what he says to do – be baptized.
Being dunked down into the water symbolizes you are dead to sin. Being raised out of the water symbolizes your new life in Christ.
It also serves as a sign to people that after you die and are buried, you will be resurrected to live eternally in the presence of God.
So if you’re already dead how can you do this?
Doctrine and Covenants 128:18; “…It is sufficient to know, in this case, that the earth will be smitten with a curse unless there is a welding link of some kind or other between the fathers and the children, upon some subject or other—and behold what is that subject? It is the baptism for the dead. For we without them cannot be made perfect; neither can they without us be made perfect. Neither can they nor we be made perfect without those who have died in the gospel also; for it is necessary in the ushering in of the dispensation of the fulness of times…”