FairMormon is a non-profit organization dedicated to providing well-documented answers to criticisms of LDS doctrine, belief and practice.
Pergunta: Como é que é possível para um líder ou profeta Igreja ter sido influenciado pelo racismo, mas ser consistente com o Senhor não permitindo profetas para a Igreja se desviar?
Question: How is it possible for a Church leader or prophet to have been influenced by racism, yet be consistent with the Lord not allowing prophets to lead the Church astray?
The goal of the Church is to bring people unto Christ
This is a difficult question. At face value, the idea that the Lord will not allow prophets to lead us astray seems to be in direct conflict with the Church acknowledging that early Church leaders and prophets were influenced by certain racist tendencies of their times. For example, how could the Priesthood ban have been implemented and yet be consistent with the prophets "not leading the Church astray?".
The first thing we must do is step back and see what the Church and prophets are all about.
What is the goal of the church?
According to Spencer W. Kimball, and reaffirmed by the other prophets it is as follows:
First, to proclaim the gospel of the Lord Jesus Christ to every nation, kindred, tongue, and people; Secondly, to perfect the Saints by preparing them to receive the ordinances of the gospel and by instruction and discipline to gain exaltation; Thirdly, to redeem the dead by performing vicarious ordinances of the gospel for those who have lived on the earth. (See Ensign, May 1981, p. 5.) All three are part of one work—to assist our Father in Heaven and His Son, Jesus Christ, in their grand and glorious mission “to bring to pass the immortality and eternal life of man.” (Moses 1:39.) I renew that declaration today. 
The purpose of the Gospel is to bring people to Jesus Christ. The Church is the organization that Jesus set up on the Earth to bring people back to Jesus and back to God so we can be joint heirs with Christ. (Romans 8:17.)
The prophets will not lead the Church astray from the mission of leading people to Christ: This does not exempt prophets from saying or doing things that are incorrect
Will the prophets lead us astray from this mission. No. They won't. They will keep us on that path and we should follow them.
Will they say things, do things, and even make policy that isn't the best, or even is incorrect. Certainly. Just as one example, Joseph Fielding Smith did not believe that men would even go to the moon. He stated in the first edition of Answers to Gospel Questions,
Naturally the wonders in the heavens that man has created will be numbered among the signs which have been predicted—the airplanes, the guided missiles, and man-made planets that revolve around the earth. Keep it in mind, however, that such man-made planets belong to this earth, and it is doubtful that man will ever be permitted to make any instrument or ship to travel through space and visit the moon or any distant planet.
He later accepted a flag from the Apollo astronauts. When asked about this by a reporter, he stated, "Well, I was wrong, wasn't I?"
In Jonah chapter 3 it says,
4 And Jonah began to enter into the city a day’s journey, and he cried, and said, Yet forty days, and Nineveh shall be overthrown.
But Nineveh wasn't overthrown. The people repented and the Lord spared them. This really upset Jonah. (This doesn't even get into the fact that he first ran away.)
The Lord uses imperfect people to run his Church
The Lord uses imperfect people to run his Church. He has promised he will make it all right in the end.
Karl G. Maeser taught:
On one occasion he was going with a group of young missionaries across the alps. They were crossing a high mountain pass on foot. There were long sticks stuck into the snow of the glacier to mark the path so that travelers could find their way safely across the glacier and down the mountain on the other side.
When they reached the summit, Brother Maeser wanted to teach the young elders a lesson. He stopped at the pinnacle of the mountain and pointed to those sticks that they had followed. And he said, “Brethren, behold the priesthood of God. They are just common old sticks, but it’s the position that counts. Follow them and you will surely be safe. Stray from them and you will surely be lost.” And so it is in the Church. We are called to leadership positions and given the power of the priesthood. And we are just common old sticks, but the position we are given counts. It is separate and apart from us, but while we hold it, we hold it. 
If we go in with the expectation that the prophets will never do or say anything wrong, we will be disappointed
If we go in with the expectation that the prophets will never do or say anything wrong, we will be disappointed. There are more examples of this than the one you gave. Even Joseph Smith was reprimanded by God on more than one occasion.
Just a few examples from history (There are also reprimands in the D&C) They started doing Baptism for the dead in the river in Nauvoo - until God stopped them. They started doing sealings of adoption- until God stopped them. Why didn't God stop the race issue? He did...but He just did it later in his time frame for His purpose.
So again, If we go in with the expectation that the prophets will never do or say anything wrong, we will be disappointed. Prophets are learning and are being taught just as we are learning and being taught. Bruce R. McConkie stated that quite clearly. 
But, if we go in with the expectation that the prophets will keep us on the Gospel path, complete with the ordinances we need to return to our Heavenly Father, then we will know that the prophets will never lead us astray.
In John 6, Jesus taught hard things:
66 ¶From that time many of his disciples went back, and walked no more with him.
67 Then said Jesus unto the twelve, Will ye also go away?
68 Then Simon Peter answered him, Lord, to whom shall we go? thou hast the words of eternal life.
We will get things wrong, because we are NOT Jesus Christ: He allows us to learn as we go along
Jesus has taught the words of eternal life. This is his Church. We will get things wrong, because we are NOT Jesus Christ. He allows us to learn as we go along. The prophets will not lead us astray from that goal of eternal life.
I also fall back onto the truthfulness of the Book of Mormon. In my mind, the evidence is very clear. Joseph Smith could not have written the Book of Mormon in 1830. Nobody could have done that. There were things that Joseph Smith and scholars of the day did not know that are contained in the book. They would have written the opposite based on the science of the day.
If the Book of Mormon is true, then Joseph Smith is a prophet of God. It also means we have a prophet today. Will they lead us astray? Is that statement even true that they won't? The prophets will not lead us astray from the Gospel path. Can they be incorrect on other issues-even involving the Church? Yes, they can. But, that isn't why we have a prophet. We have a prophet to help us return to our Heavenly Father. As such, we follow him. God will make it all right in our eternal lives.