Things got especially messy when founder Joseph Smith received a revelation that he should start taking more wives. Lots more. Soon he was encouraging other Mormon men to do the same. This diminished the available supply of comely young women, which upset a lot of non-Mormon men, especially the bachelors. For this reasons — among others — an angry mob killed Smith in 1844.
This left master-organizer Brigham Young in charge. He solved the angry-bachelor problem by deciding to move the Mormons west to a place that had no white settlements. Thus began the Mormon exodus to the Salt Lake basin in the mid-1840s.