Why were blacks not permitted to have the priesthood in the LDS church?
People of color were not permitted to hold the priesthood in the LDS church until 1978. Nowadays, they can hold any priesthood office in the church. That's quite a difference! Why the change?
The history of the LDS church leading up to 1978 gives us a good view on the issue. Some feel that the situation was similar to Christ's temporary denial of baptism to the Gentiles in New Testament times (Acts 10:15-28).
If you're interested in the history of blacks and the LDS priesthood, you should check out the great timeline available at BlackLDS.org.
If you are wondering why God would "just decide one day" that people of color could hold the priesthood, or if you wonder if the LDS church was full of racists, I recommend reading up on the history at the same website.
The LDS.org website also has a well-researched article on Race and the Priesthood with the following information:
Church leaders pondered promises made by prophets such as Brigham Young that black members would one day receive priesthood and temple blessings. In June 1978, after “spending many hours in the Upper Room of the [Salt Lake] Temple supplicating the Lord for divine guidance,” Church President Spencer W. Kimball, his counselors in the First Presidency, and members of the Quorum of the Twelve Apostles received a revelation. “He has heard our prayers, and by revelation has confirmed that the long-promised day has come,” the First Presidency announced on June 8. The First Presidency stated that they were “aware of the promises made by the prophets and presidents of the Church who have preceded us” that “all of our brethren who are worthy may receive the priesthood.