Writing from UK perspective, a lot of social housing was built after the second world war, these were funded by local councils and provided subsidised cheap rent for the working poor. These were primarily built on the outskirts of towns or on areas that had been bombed during the war. During the 80s the Tory government introduced the 'right to buy' scheme which allowed council tenants to buy the house they lived in, often below the market value, therefore the most attractive social housing (often in the city) went into private hands. At the same time, local councils changed their policy so that social housing was largely reserved for those who were dependant on benefits. This had the effect of pushing people with drug and social problems to often poorly maintained and poorly serviced out of town estates which transitioned into ghettos. This is a very brief summary of a very complex topic, but it could be argued that many of social and housing problems in Britain today can be traced back to these two bad decisions.
I can't answer for Europe, but in the United States, it dates back to the post-WW2 era.
After WW2, millions of returning veterans took the government up on its offer for free education and low cost houses through the GI Bill and the VA. However, black veterans were excluded from the massive benefits of the GI Bill and Home Loans. This led to an enormous amount of blacks staying in poverty.
Simultaneously, the houses that whites bought were subsidized by the government and built in the suburbs. This led to what was called "White Flight" in which many whites left the cities to their cheap house in the suburbs. Combine this with government spending going to whites and neglecting the Inner City full of blacks, led to the deterioration of the latter.
Source: When Affirmative Action was White, by Ira Katznelson.
Edit: Fixed typo.