Alma was careful not to imply that the wicked as well as the righteous would come forth from the grave at the same time. He spoke of those who died before the Resurrection of Christ.
The Prophet Abinadi who ministered to the People of Zeniff in the Land of Nephi and whose words were recorded by Alma, the father of Alma who later became the Presiding High Priest of God’s Church, and whose occupancy of that position we are now discussing: But behold, the bands of death shall be broken, and the Son reigneth, and hath power over the dead; therefore, He bringeth to pass the resurrection of the dead.
And there cometh a resurrection, even a first resurrection; yea, even a resurrection of those that have been, and who are, and who shall be, even until the resurrection of Christ—for so shall He be called.
And now, the resurrection of all the prophets, and all those that have believed in their words, or all those that have kept the commandments of God, shall come forth in the first resurrection; therefore, they are the first resurrection.
They are raised to dwell with God Who has redeemed them; thus they have Eternal Life through Christ, Who has broken the bands of death.
And these are those who have part in the first resurrection; and these are they that have died before Christ came, in their ignorance, not having Salvation declared unto them. And thus the Lord bringeth about the resurrection of these; and they have a part in the first resurrection, or have Eternal Life, being redeemed by the Lord. (Mosiah 15:20-24)
In verse 20, Alma gives as his opinion that only the spirits of the righteous shall be resurrected at the time when Christ, Himself, shall rise from the dead, and shall ascend into Heaven.
When we speak of a first resurrection it is best not to imagine that the term refers to a separate and distinct period of time in which some who are chosen will come forth from the dead. Unless the chosen are the righteous ones, the words, themselves, provoke misconceptions in considering the prophetic understanding of the Resurrection as a definite continuous period during which all men will be raised from the dead. First resurrection is better understood as not referring principally to time, but as a reward for righteous living. First resurrection is a resurrection of the just. “The resurrection of Christ and of the righteous who died before His coming is not, however, all that is meant by the ”first resurrection“ as indicated by the promises which are yet being made to the living. Moroni, who lived long after the time of Christ, was nevertheless of the ”first resurrection.“ The problem is somewhat clarified if we use the terms ”resurrection of the just“ and ”resurrection of the unjust.“ The resurrection of the just, whenever it may occur precedes the resurrection of the unjust and is hence a ”first resurrection.“ So resurrections of the righteous, yet to take place, are a ”first resurrection“ as contrasted with the last resurrection which shall take place at the end of the Millennium. The promise is repeatedly found in Scripture that, at the second coming of Christ, the righteous dead who have not previously been resurrected, will arise from their graves and dwell on the earth during the Millennium. This resurrection, being definitely a resurrection of the ”just,“ is also a ”first resurrection," and it is the promise of this resurrection which is used in temple ordinances and patriarchal blessings in our day. (William E. Berrett, Teachings of the Book of Mormon, p. 58)
And again we bear record—for we saw and heard, and this is the testimony of the gospel of Christ concerning them who shall come forth in the resurrection of the just—
They are they who received the testimony of Jesus, and believed on his name and were baptized after the manner of his burial, being buried in the water in his name, and this according to the commandment which he has given—
That by keeping the commandments they might be washed and cleansed from all their sins, and receive the Holy Spirit by the laying on of the hands of him who is ordained and sealed unto this power;
And who overcome by faith, and are sealed by the Holy Spirit of promise, which the Father sheds forth upon all those who are just and true.
They are they who are the church of the Firstborn.
They are they into whose hands the Father has given all things—
They are they who are priests and kings, who have received of his fulness, and of his glory;
And are priests of the Most High, after the order of Melchizedek, which was after the order of Enoch, which was after the order of the Only Begotten Son.
Wherefore, as it is written, they are gods, even the sons of God—
Wherefore, all things are theirs, whether life or death, or things present, or things to come, all are theirs and they are Christ’s, and Christ is God’s.
And they shall overcome all things.
Wherefore, let no man glory in man, but rather let him glory in God, who shall subdue all enemies under his feet.
These shall dwell in the presence of God and his Christ forever and ever.
These are they whom he shall bring with him, when he shall come in the clouds of heaven to reign on the earth over his people.
These are they who shall have part in the first resurrection.
These are they who shall come forth in the resurrection of the just.
These are they who are come unto Mount Zion, and unto the city of the living God, the heavenly place, the holiest of all.
These are they who have come to an innumerable company of angels, to the general assembly and church of Enoch, and of the Firstborn.
These are they whose names are written in heaven, where God and Christ are the judge of all.
These are they who are just men made perfect through Jesus the mediator of the new covenant, who wrought out this perfect atonement through the shedding of his own blood.
These are they whose bodies are celestial, whose glory is that of the sun, even the glory of God, the highest of all, whose glory the sun of the firmament is written of as being typical. (Doctrine and Covenants, D&C 76:50-70)