I think I can provide an answer to this one. Qualifications: I have an MA in Religious Studies with a focus on religion in North America and I am a PhD Candidate in that same specialty currently writing my dissertation which has Mormonism as one of the primary topics.
A good place to start with this question is with historian Armand Mauss. In his book The Angel and the Beehive: The Mormon Struggle with Assimilation he asserts that throughout its history the Church of Jesus Christ of Latter-day Saints has swung between two impulses: cultural assimilation and retrenchment.
He argues that the church goes through distinct periods where it will make efforts to assimilate to the broader culture, and periods where it will retrench to emphasize those elements which make it unique or "peculiar" (his term). The phenomenon that you are asking about is a result of periods of assimilation, particularly in the post-war period.
With that introduction out of the way, there are several events throughout Mormon history which we can point to to answer your question about assimilation.
One of the biggest is what we call the 1890 Manifesto wherein then President of the church Wilford Woodruff issued a proclamation pausing the practice of plural marriage (yes, it officially is paused, rather than abolished). There were several mitigating factors that led to this; Utah Territory was attempting to join the US as a state, but the practice of plural marriage was a sticking point. The 1887 Edmunds-Tucker Act had functionally disincorporated the church, authorizing federal agents to raid and seize church assets and Mormon men in particular were being arrested with increasing frequency for bigamy. Essentially the church was at an impasse: they could abandon plural marriage or they would be driven out of the US and associated territories.
While it is true that they had been driven out of several previous states they had established a prosperous settlement in Utah and the current leader, Woodruff, was less willing than previous had been to uproot and flee. He began quietly refusing to approve new plural marriages, and then released the proclamation in 1890 after claiming to have received a direct revelation from God (you can read it here). This concession set the stage for Utah to become a state, which it did in 1896. There are a lot of good references for further reading, I recommend the work of Michael Quinn, particularly The Mormon Hierarchy.
This is already getting long, but it is a big question! The next event towards assimilation was the 1903 election of Reed Smoot as a senator to represent Utah. He was purposefully chosen to run because he was well-respected throughout the state and, more importantly, he was not a polygamist. He was politically savvy, friendly, and middle class, thus combating popular perceptions of Mormons at the time. However he was not seated, and there was a four year long senate hearing to determine whether he was fit to serve. Ultimately this was a first amendment issue, and Smoot argued that his faith was a personal, not professional, matter. He sort of created the blueprint for how most members of minority religious groups would deal with questions about their faith when running for office. Ultimately he was able to take his seat and held it for 30 years. Historian Kathleen Flake wrote The Politics of American Religious Identity: The Seating of Senator Reed Smoot, Mormon Apostle, which is probably the definitive book on Reed Smoot. She argues that the US senate’s solution was to require Mormons to conform to protestant norms, particularly to present like a denomination with standardized behaviors and obedience to the law, and in return they got political representation and legitimacy.
We can skip forward a little to the Eisenhower administration. In 1952 Eisenhower chose Ezra Taft Benson, who was a member of The Quorum of the Twelve Apostles (meaning he was high up in the governing body of the LDS Church) to be Secretary of Agriculture. Benson was a prominent leader in the church, so his appointment to the cabinet granted major legitimacy. This was a huge turning point, and arguably cemented the relationship between the LDS Church and the Republican Party, whereas previously church hierarchy had been much more bipartisan (see Mauss, 115). Benson would go on the serve as President of the church and was instrumental in shaping its conservative political identity, particularly in response to the hippie movement, feminism, and other socially progressive movements of the 1960s. In this era Mormons took on the squeaky clean image that they (largely) still have because their image was shaped in the public consciousness by religious elements like patriotism, an emphasis on so-called family values, etc. rather than those that were perceived as peculiar or deviant.
There is a ton more that could be said on this topic, particularly about the political shift like their opposition to the ERA, but a final thing I will talk about happened in 1978, which was the year that the church made a doctrinal change that some argue was nearly as important as the 1890 Manifesto. Prior to 1978 Black men were not considered to hold the priesthood (very quickly: in LDS doctrine men over the age of 12 are endowed with the priesthood which grants them both special authorities and powers and is important for participating in Temple ceremonies and progression in the afterlife). Black men did not have the priesthood and thus were limited in both spiritual and communal authority and were barred from leadership positions. This doctrine (rightly!) received heavy criticism both internally and externally, and was one of the most visible holdovers of the type of religious peculiarity which put Mormons outside of the mainstream. In 1978 then church President Spencer Kimball, after many prayer sessions, received a revelation which removed all barriers preventing Black men from holding the priesthood. The change was announced in June of 1978 and is recorded in the Doctrine and Covenants as Official Declaration 2.
Ultimately I would argue that it was the political stability that the church gained post Reed Smoot which allowed for the cultural and theological negotiations which were necessary to take them from the margins of American society into the mainstream.