From my perspective, what occurred is that people wanted desegregation in principle but not in their particular social circles. They didn’t want large numbers of black students in their child’s school for instance.
These laws were passed in an environment of both great social upheaval domestically, and the cold war internationally. Both contributed.
The Soviet Union kept pointing out US race relations whenever the US claimed to be for freedom. The hypocrisy of the US could not be ignored by the predominantly white christian leaders who enacted these laws while expecting to have any credibility abroad. And, now that the cold war is over, the predominantly white christian political right is attempting to dismantle every single one of these acts and more.
It's also the era that created the Civil Rights Act, the Voting Rights Act, Medicare, Medicaid and the War on Poverty. You're correct that political leadership in the United States was almost entirely white at the time. But the fact that they passed many substantial pieces of legislation helping other groups shows that people are more decent than the "race war" narrative that gets pushed a lot these days.