Alma was already an ordained priest with enough authority to perform baptism. He may well have been baptized before this event. If so, his rebaptism would have been symbolic of his own repentance (v. 1) and desire to serve God for the rest of his life.
Joseph Fielding Smith
"Therefore, when Alma baptized himself with Helam that was not a case of Alma baptizing himself, but merely as a token to the Lord of his humility and full repentance. In Alma 5:3 we learn that Alma [the younger] was consecrated the high priest over the Church under his father. Now Alma did not organize the Church with the idea that they had no church before that time. They had a church from the days of Lehi and Alma only set things in order." (Answers to Gospel Questions, vol. 3, pp. 203-4)