> Reagan was installed because republicans ... were upset about the civil rights movement.
While I think that motivation was involved, I think a much stronger argument is that Reagan was elected because interest rates and inflation reached ~20%, unimaginable numbers today. It's very hard to imagine anyone getting re-elected in that situation.
Also, international affairs played a role: The US had suffered a highly demoralizing defeat in Vietnam, was being humiliated by the Iranians holding US hostages, and looked weak in regard to the USSR. Reagan promised a new, more aggressive approach.
Also, it wasn't so much Republicans who elected Reagan but Democrats - 'Reagan Democrats' - who crossed over and elected Reagan, who won overwhelmingly: 489-49 in the electoral college, 42-8 states, 44-35 million popular vote.
Believe it or not, for most of history people did not so strictly vote for parties. Johnson beat Goldwater and Nixon beat McGovern similarly.
> republicans and racists (I repeat myself)
It depends on your definition of racist. IMHO a few people actively strategize for racism and/or white (male and/or Christan) nationalism; in the US they probably are Republican if anything, I think.
Most people follow the behavior and norms of those around them (the strategists target them by normalizing racists behavior). They don't have strong beliefs and are racists mostly by ignorance, IMHO. That's not an excuse - we are responsible for our actions and ignorance just adds another layer to our errors.
Certainly not all Republicans are racist. You might ask, how can they vote for candidates pushing openly or subtly racist policies? The same could be asked of Democrats in many elections.
Many white democrats and their candidates are similarly racist from ignorance, and probably more were back then. From what I've read, most thought that racism had been resolved due to the mid-1960s laws such as the Voting Rights Act, and there were few problems remaining. That was and is a laughably ignorant point of view. You can see people today embrace it - see polls on how many white people think racism is a solved problem and how many black people experience it. How many white people think that the job market is generally a meritocracy (that somehow yields rewards to mostly white people, especially men). How many do nothing in the face of generations of discrimination Plenty bought into the dog-whistle anti-school busing movement, or Bill Clinton's 'superpredator' policy.
Martin Luther King's Letter from a Birmingham Jail was directed to the "white moderate"; an excerpt:
"... I must confess that over the past few years I have been gravely disappointed with the white moderate. I have almost reached the regrettable conclusion that the Negro's great stumbling block in his stride toward freedom is not the White Citizen's Counciler or the Ku Klux Klanner, but the white moderate, who is more devoted to "order" than to justice; who prefers a negative peace which is the absence of tension to a positive peace which is the presence of justice; who constantly says: "I agree with you in the goal you seek, but I cannot agree with your methods of direct action"; who paternalistically believes he can set the timetable for another man's freedom; who lives by a mythical concept of time and who constantly advises the Negro to wait for a "more convenient season." Shallow understanding from people of good will is more frustrating than absolute misunderstanding from people of ill will. Lukewarm acceptance is much more bewildering than outright rejection. ..."