Part of the problem is the profit margins for developers aren't actually as big as people generally think, most of the sector, oarticularly at professional level, has a severe shortage of people working in it, and its being made more and more diffuclt with red tape to actually build houses.
The government and local councils on one hand are actively trying to get developers to build, but then they invariably have to fight a sometimes lengthly battle with the local planning to get permission, then the regs keep being made complex. Now a house has to be energy efficient enough to keep warm, but can't be too warm in case it overheats, so has to also be very well ventilated, but can't be too well ventilated because then it wont stay warm, but can't be too underventilated because the rules on ventilation have also been made harder to comply with....and this is just for standard two/three storey houses. Once you get into blocks of flats the fire regulations are a minefield now. One of the things to come out of Grenfell was that the regulations were too complicaed and even experts didn't understand them. Now they are even more complicated. You also can't start any work until all of your designs have been approved as compliant, which makes sense in principle but only a specialist level registered surveyor can check them, and there aren't many of those because that's another relatively new thing and the process to get registered/validated at specialist level really isn't worth the hassle to most surveyors (who there are nowhere near enough of anyway). Either that or they get told tey aren't experienced enough. Even when a specilaist does check it, its highly unlikely they'd approve everything straight away, because there are too many regulations to check and too much vagueness within them for that to ever happen. Even once everything has been approved - I have yet to be on any site where there hasn't been an issue that's meant the design has had to be changed anyway, so then you go back through the whole process again.
Then IF they do manage to get as far as building them, a lot of the time, partiularly with flats, they end up pre-selling a majority to an investor as that's the only way they guarantee they aren't going to make a huge loss. The investor then rents them at an extortionate price. Basically no one is building affordable housing because they system is set up so that if you do that, you will lose money.
What there should be is a stream lined processand a rule that one person or whatever business they set themselves up as cannot rent more than say, 3 properties at a time. Neither of these things will happen though because both would involve people losing money who are currently getting it by doing absolutely feck all.
The whole buy a house just to do it up and immediately sell it for a profit culture also needs to die a death. You have a cycle where either the housing market stalls or as soon as it picks up this practice along with landlords being greedy over rent helps push the prices up at 3 times the speed that is healthy. People in this country seem to see a house as a financial/profit tool rather than a home which is not only greedy but pretty dumb.