Over the course of a life-time of activity in the church, members will see people in somewhat prominent local callings make major mistakes and end up leaving the church. I personally have known a counselor in a Bishopric get excommunicated and have heard of people in even more prominent positions (Bishop, Stake President, Patriarch, Mission President) also leave the church due to major sins. One question people have is "why did God call them in the first place? Didn't he know what they would do?" Obviously, the most famous example is Judas betraying the Savior, so this is something that has always happened.
Although God certainly knew what they would do, here's a few thoughts:
1) Elder Eyring came to BYU and said that often God uses a soft hand to guide things, but his hand is there. He is very involved, but he doesn't push too hard so that we may all grow as a part of the experience and so the experience is fair.
2) God gives people chances to lead and prove themselves. He does not immediately give up on people and take away their opportunities.
In general #2 is true for everyone. People in all walks of life have numerous opportunities to come to God. This is true for nonmembers and members, your average LDS church member and even your church leaders. Here's an example from D.C. 124:
Sidney Rigdon was in the First Presidency and by many accounts wasn't healthy after a brutal beating he endured in Kirtland, Ohio. However, he did a lot of good and was a member of the First Presidency. He was also in the Carthage Jail but the judge told him that if Sidney would say he'd suffered as much as Jesus, the judge would release him. Sidney said it, so he was released. The other brethren, including the prophet and his brother stayed in jail for 6 months.
When persecution started happening in Nauvoo, Sidney contemplated moving away from the city with his family and then doing missionary work but without his family in Nauvoo. Based on what Sidney had already done poorly, some might think that he should have just been released from his calling (First Counselor in the First Presidency). However, Joseph received a revelation that gives Sidney an extra chance. God tells Sidney to stick around, to serve, and if he does, he would be healed.
Unfortunately, Sidney didn't listen. However, I like having a God lead the church who is willing to give people second chances and third chances.
103And again, verily I say unto you, if my servant Sidney will serve me and be a unto my servant Joseph, let him arise and come up and stand in the office of his calling, and humble himself before me.
104And if he will offer unto me an acceptable offering, and acknowledgments, and remain with my people, behold, I, the Lord your God, will heal him that he shall be healed; and he shall lift up his voice again on the mountains, and be a a before my face.
105Let him come and locate his family in the neighborhood in which my servant Joseph resides.
106And in all his journeyings let him lift up his voice as with the sound of a trump, and warn the inhabitants of the earth to flee the wrath to come.
107Let him assist my servant Joseph, and also let my servant William Law assist my servant Joseph, in making a solemna unto the kings of the earth, even as I have before said unto you.
108If my servant Sidney will do my will, let him not remove his family unto the a lands, but let him change their habitation, even as I have said.
109Behold, it is not my will that he shall seek to find safety and refuge out of the city which I have appointed unto you, even the city of Nauvoo.
110Verily I say unto you, even now, if he will hearken unto my voice, it shall be well with him. Even so. Amen.