Then 1964 happened. And the GOP Presidential nomination was won by a good man (Goldwater) who took a bad position (against the Civil Rights Act).
Some of those former Democrats who had segregationist views found a new home in the GOP. And then the Southern Strategy happened.