To say that the Nephites were righteous and that the Lamanites were wicked is an oversimplification. The righteousness of the Nephites fluctuated greatly over their history. The Nephite prophets were working hard to keep the people from falling into wickedness. The Lord had promised that when the Nephites became wicked, he would send wars and destructions upon them, and they were having wars all the time. To this point, Nephi, Jacob, and Enos had witnessed great wars between the two peoples. This unfortunate pattern continues for the rest of the book of Mormon.
The only weapon that the prophets had against this wickedness was the preaching of the word. And now, as the preaching of the word had a great tendency to lead the people to do that which was just—yea, it had had more powerful effect upon the minds of he people than the sword, or anything else which had happened unto them—therefore Alma thought it was expedient that they should try the virtue of the word of God (Alma 30:5). This preaching had an effect until the days of Mormon, when the wickedness reached its peak. Behold, I am laboring with them continually; and when I speak the word of God with sharpness they tremble and anger against me; and when I use no sharpness they harden their hearts against it; wherefore, I fear lest the Spirit of the Lord hath ceased striving with them (Moroni 9:4).