TaNehisi Coates has popularized some academic research showing how geographically segregated America is. Sometimes the assertion is that white-dominated government programs have enforced and propagated segregated housing.
The assertion is true. But it's also incomplete.
Emily Badger in the Post reports on"...new research,[studying] how the arrival of blacks in 10 northern cities at the
time influenced white behavior. Over the course of the first
three decades after the turn of the century, coinciding with the start
of the Great Migration of blacks out of the South, this pattern
accelerated: As blacks arrived in northern neighborhoods, more whites
left. By the 1920s, there were more than three white departures for
every black arrival."
These patterns mostly preceded formal and legal patterns (restrictive covenants, redlining).
The Post article doesn't mention it, but there's also the phenomena of chain migration leading to ethnic neighborhoods. We can see that in American history as Irish, Italians, East European Jews, Germans, each settled in distinct neighborhoods. I suspect that's the result of mixed forces: the comfort and familiarity of living close to others from the same country, sometimes the same town and the economics of buying and selling--the newcomer is willing to pay higher prices (usually in the form of crowding) for housing than other potential buyers, so you get a force which leads to segregation. (See Schelling and his general theory of tipping.)
What the economist doesn't throw into the mix, at least as I remember the essay which is 45 years old now, is the emotions generated by attachments to home and fear of the "other". Nor does he address the effects of a general level of bias.
So, in my mind, we have a vicious circle which can start relatively innocently, is propelled by economic logic, and becomes intermixed with emotion and bias, leading finally to the erection of legal and formal barriers. We saw the extreme case of that in South Africa in the days of apartheid, and in Nazi Germany.
So my answer to the question asked in the title: government is often, at least in the US, more the tail than the dog.
The next question is: can you make government the dog and reverse the vicious circle? That's what we've been trying, fitfully, off and on since the New Deal.