The Apostle Paul wrote to the Hebrews explaining why the Lord chastens those whom he loves (Hebrews 12:5–11). Mormon is giving similar counsel to the Book of Mormon reader (Helaman 12:3–6). The Lord revealed the same concept to Joseph Smith in the latter days:
1 Verily, thus saith the Lord unto you whom I love, and whom I love I also chasten that their sins may be forgiven, for with the chastisement I prepare a way for their deliverance in all things out of temptation, and I have loved you—
2 Wherefore, ye must needs be chastened and stand rebuked before my face; [D&C 95:1–2]
Another reason for chastisement is given by Mormon, “to remember the Lord” (vv. 3, 5). The Lord wants his people to remember him so he can bless them.
20 There is a law, irrevocably decreed in heaven before the foundations of this world, upon which all blessings are predicated—
21 And when we obtain any blessing from God, it is by obedience to that law upon which it is predicated. [D&C 130:20–21]
However, as Mormon points out, it is not the natural manner of man to follow the Lord but to hearken to the evil one (vv. 4–6).