Alma 51:16 - 51:20
Alma 51: 16 For it was his first care to put an end to such contentions and dissensions among the people; for behold, this had been hitherto a cause of all their destruction. And it came to pass that it was granted according to the voice of the people.
It was Moroni’s desire to make sure the people were untiled as it would be required to face the Lamanites when they invaded. The contentions and wickedness of the past had been what had brought all the troubles they had experienced over the years from each other and the Lamanites.
Alma 51: 17 And it came to pass that Moroni commanded that his army should go against those king-men, to pull down their pride and their nobility and level them with the earth, or they should take up arms and support the cause of liberty.
This was the motivation of Moroni sending some of his army against the kingsmen. He was either going to pull down their pride thinking they were better than the rest of the population and forced them to either fight the Lamanites or he would execute any who refused.
Alma 51: 18 And it came to pass that the armies did march forth against them; and they did pull down their pride and their nobility, insomuch that as they did lift their weapons of war to fight against the men of Moroni they were hewn down and leveled to the earth.
So that is what happened to the kingsmen. Those who resisted and try to fight Moroni’s men were quickly dispatch to the spirit world.
Alma 51: 19 And it came to pass that there were four thousand of those dissenters who were hewn down by the sword; and those of their leaders who were not slain in battle were taken and cast into prison, for there was no time for their trials at this period.
About 4000 thousand kingsmen were killed in the fighting. Their leaders were capture and thrown into prison as there was no time for trials.
Alma 51: 20 And the remainder of those dissenters, rather than be smitten down to the earth by the sword, yielded to the standard of liberty, and were compelled to hoist the title of liberty upon their towers, and in their cities, and to take up arms in defence of their country.
Those who were not killed or arrested had to either give an oath to defend the country or die.