Racism played a part too of course but class is often completely ignored in the USA.
See also block busting.
Many properties in areas that were claimed to be "block busted" by revisionists were of low build quality to begin with were aging out and were unlikely to be revitalized by whoever lived there in the future. As I mentioned, because of the depression and WW2 there were not many new things being built and the existing stock in many of these areas was already low quality to begin with and had gone decades without much investment. Therefore the demand was low for these properties and lower class people were the market for them. So the neighborhood began to change and more crime was brought into these places which only accelerated the plummeting of values.
People act like an area of affluent people living in high quality homes all ran for the hills as soon as a black family moved in and the prices plummeted. No, it was places like the south side of Chicago which were always working class and full of small, cramped living places. Building huge housing project towers in these areas didn't help either, nor did the highway systems that cut through these areas. But people got out because the living conditions sucked compared to what was available in the new suburbs being built. Not to mentioned, jobs were moving out of cities because business could expand to new locations that were safer and not cramped.
Did race play role? Sure. As did class to a greater extent. But the narrative you hear and accepted as fact just doesn't reflect the total reality.
The first person to integrate that neighborhood was a banking magnate. They bombed his house. Five times. They bombed banks and real estate agents who sold or lent to blacks.
Racial covenants were popularized as the more progressive way to keep neighborhoods segregated because racial violence was so bad.