However, not all suffering is caused by sin. One terrible event in the Book of Mormon partially explains why innocent people can suffer. "For behold the Lord receiveth them [martyrs and other righteous] up unto himself, in glory; and he doth suffer that they may do this thing, or that the people may do this thing unto them, according to the hardness of their hearts, that the judgments which he shall exercise upon them in his wealth may be just; and the blood of the innocent shall stand as a witness against them, yea, and cry mightily against them at the last day." (Alma 14:11). We have been given agency and the Lord lets us be agents unto ourselves if we so desire.
The Lord's mission, His work and glory, is "to bring to pass the immortality and eternal life of man" (Moses 1:39) so anything that furthers or does not hinder His work, is allowed to happen; in this case it is the death of many women and children - horrific but not tragic in the eternal perspective. Those who killed the women and children will receive the fruits of their labors. They will have to stand before the Judgment Seat and hear the witness against them by these individuals. There are many other examples of the wicked being responsible for causing the righteous much suffering: "But behold, now the Lamanites are coming upon us, taking possession of our lands, and they are murdering our people with the sword, yea, our women and our children, and also carrying them away captive, causing them that they should suffer all manner of afflictions, and this because of the great wickedness of those who are seeking for power and authority" (Alma 60:17).
For the most part, people are free to do what they choose. However, freedom of choice does not imply freedom from responsibility. Those who killed the innocents and caused them to suffer would in turn have to suffer for their choices. The idea of suffering seems to contradict what the Book of Mormon prophet Jacob taught: "men are...that they might have joy" (2 Ne. 2:25). We can have joy in this life but that does not mean we are free from suffering.
Additionally, we can have joy in our suffering. That does not mean we enjoy our suffering; rather, we rejoice in it because of what we can learn from it and what it can bring. The apostle Peter taught: "But rejoice, inasmuch as ye are partakers of Christ's sufferings; that, when his glory shall be revealed, ye may be glad also with exceeding joy" (1 Pet. 4:13). Other suffering can bring more immediate joy. Think of a mother in labor. She experiences great suffering and pain, suffering which can even lead to death. In labor, many mothers place one foot in the grave in order to bring forth new life. After the suffering and trial comes great joy; joy in new life; joy in a child. However, some mothers fear the suffering of labor while others joy in it. What's the difference? It could be past experience. It could be that some mothers are focused on the immediate pain and suffering while others focus on the outcome and the miracle of the whole experience. Those mothers have more than just perspective. They understand the suffering - what it means, its outcome, and its purpose. When we are righteous, the Lord promised that we will "reap eternal joy for all our sufferings" (D&C 109:76).