Modern conservatives are oddly fond of pointing out that it was Democrats who were the party of racism and racists until half a century ago. There's always an implied "Aha!" whenever a conservative mentions this, as though they think it's some little-known quirk of history that Democrats try to keep hidden because it's so embarrassing.
It's not, of course. Abraham Lincoln was the first Republican president, and Republicans were the face of Reconstruction and voting rights for blacks after the Civil War. Because of this, the South became solidly Democratic and stayed that way until World War II. But in the 1940s, racist white southerners gradually began defecting to the Republican Party, and then began defecting en masse during the fight over the 1964 Civil Rights Act.
But wait: the 1940s? If Southern whites began defecting that early, then partisan changes in racial tolerance couldn't have been their motivation. Right?
But it was. The Civil Rights movement didn't spring out of nothing in 1964, after all. Eleanor Roosevelt was a tireless champion of civil rights, and famously resigned from the DAR when they refused to allow singer Marian Anderson to perform at Constitution Hall in 1939. FDR was far more constrained by his need for Southern votes in Congress—and it showed in most New Deal programs—but the WPA gave blacks a fair shake and Harold Ickes poured a lot of money into black schools and hospitals in the South. In 1941 FDR signed a nondiscrimination order for the national defense industry—the first of its kind—and he generally provided African-Americans with more visibility in his administration than they had ever enjoyed before. After decades of getting little back from Republicans despite their loyal support, this was enough to make blacks a key part of the New Deal Coalition and turn them into an increasingly solid voting bloc for the Democratic Party.
From a Southern white perspective, this made the Democratic Party a less welcoming home, and it continued to get less welcoming in the two decades that followed. Harry Truman integrated the military in 1948, and Hubert Humphrey famously delivered a stemwinding civil rights speech at the Democratic convention that year. LBJ was instrumental in passing the Civil Rights Act of 1957, while Republican Dwight Eisenhower was widely viewed—rightly or wrongly—as unsympathetic to civil rights during the 1950s.
In other words, Southern whites who wanted to keep Jim Crow intact had plenty of reasons to steadily desert the Democratic Party and join the GOP starting around World War II. By the early 60s they were primed and ready to begin a massive exodus from the increasingly black-friendly Democratic Party, and exit they did. Barry Goldwater, the 1964 GOP nominee, refused to support the Civil Rights Act that year, and influential conservative thinkers like William F. Buckley were decidedly unfriendly toward black equality. This made the Republican Party more and more appealing to Southern white racists, and by 1968 Richard Nixon decided to explicitly reach out to them with a campaign based on states' rights and "law and order." Over the next two decades, the Democratic Party became ever less tolerant of racist sentiment and the exodus continued. By 1994, when Georgia Republican Newt Gingrich won a landslide victory in the midterm elections, the transition of the white South from solidly Democratic to solidly Republican was basically complete.
This history is what makes the conservative habit of pointing out that Democrats were the original racists so peculiar. It's true, but it makes the transformation of the party even more admirable. Losing the South was a huge electoral risk, but Democrats took that risk anyway. That made it far more meaningful and courageous than if there had been no price to pay.
Despite all this, conservatives still like to argue that the surge in Southern white support for the Republican Party was driven not by racism, but by other factors: economic growth; migration from other regions; and by the evolution of Democratic views on redistribution, free speech, abortion, and other issues. Unfortunately, it's hard to find quantitative data that can settle this dispute.
But a couple of researchers recently found some: Gallup poll data starting in the late 50s that asks if you'd be willing to vote for a qualified presidential candidate who happened to be black. Respondents who answered no were coded (quite reasonably) as racially conservative. They then looked at differences between the Democratic Party ID of Southern whites who were and weren't racially conservative. Here's their conclusion:
We find that except for issues involving racial integration and discrimination, whites in the South and elsewhere have indistinguishable preferences on both domestic and foreign policy in the 1950s....We find no evidence that white Southerners who have negative views of women, Catholics or Jews differentially leave the Democratic party in 1963; the exodus is specific to those who are racially conservative. Finally, we find no role for Southern economic development in explaining dealignment.
The charts on the right show one specific data point: JFK's televised civil rights speech of June 11, 1963. Among Southern whites, approval of JFK plummets right at that moment (top chart). And in the Gallup polls, racially conservative Southern whites leave the party in droves (bottom chart). This is not a steady decline. It's a sharp, sudden exodus at a specific moment in time.
So: why did Democrats lose the white South? For the reason common sense and all the evidence suggests: because the party became too liberal on civil rights, and racist white Southerners didn't like it. Southern white flight from the party began in the 1940s, took a sharp dive in the early 60s, and continued to decline for several decades after as Democrats became ever more committed to black equality. This might not be the only reason for Southern realignment, but it's surely the most important by a long stretch.
For more on both this study and the Southern Strategy of the Nixon era, Wonkblog's Max Ehrenfreund has you covered.