5 And now in the reign of Mosiah they were not half so numerous as the people of God; but because of the dissensions among the brethren they became more numerous.6 For it came to pass that they did deceive many with their flattering words, who were in the church, and did cause them to commit many sins; therefore it became expedient that those who committed sin, that were in the church, should be admonished by the church.
36 And those that would not confess their sins and repent of their iniquity, the same were not numbered among the people of the church, and their names were blotted out.
37 And it came to pass that Alma did regulate all the affairs of the church; and they began again to have peace and to prosper exceedingly in the affairs of the church, walking circumspectly before God, receiving many, and baptizing many.
In this chapter we learn that many of the youth began to have doubts and to not believe in the teachings of King Benjamin. They began to doubt the fundamental doctrines of the Gospel of Christ.
Mormon suggests that while some of the doubt was caused by external sources, much of the dissension was caused from within the Church. When the brethren (here I read this word as referring to members and especially leaders of the Church) were unified, the youth were not led far astray.
But as dissension and false teachings crept up within the Church, many began to fall away. These alleged members taught falsely that wickedness was not sin. They encouraged the youth to indulge in sins. They flattered them and likely taught them that God would not judge them for their deeds. It is also clear that they taught the youth to disbelieve in the need to have faith in Christ and the notion of divine accountability (teaching against the resurrection frequently has this impact).
It seems pretty clear that it was dissension within the Church rather than opposition without that led to the youth falling away.
Alma turned to the Lord for guidance on what to do. He was clearly told that those who were leading members astray into sin would have to be called to repentance. And those who would not repent would have to be blotted out from the Church. And after this was done and the affairs of the Church were put in order, the Church and its members began to prosper again.
I think this chapter is illustrative of why the Church must at times maintain boundaries and excommunicate members. Allowing someone who teaches heretic teachings to remain a member does doubt and confusion which is especially felt strongly by the youth.
Discipline and excommunication are essential to allow the Church to clearly indicate that certain teachings or actions are beyond the pale. It sends a clear signal which keeps people away from the edges or boundaries of inappropriate behavior.
The church prospers when unity rather than confusion prevails.