That's not because of building codes. That's because of people who don't believe in helping their fellow man through, oh I don't know, paying taxes, supporting the welfare state, paying living wages etc.
Well, ok, since you started it - how much do you, personally, donate to homeless shelters and food banks? You have a lot of discretionary income to do so since your taxes are lower than you appear that you would like them to be.
Spoiler alert: Unfortunately, no matter how much money or time you give to this organization, or similar, the ills of capitalism inflicted on the poorest residents in the area won't be solved.
I still donate anyway though.
Am I really supposed to believe that we could build an entire cargo ship every 3 days out of 18 shipyards in 1942, but we somehow can't build a million simple and dirt cheap homes?