From the 1970s–1980s, UK government local authorities stopped building homes:
(Source: BBC News)
Or, with raw figures from the Ministry of Housing, Communities & Local Government spreadsheet, extracting figures for England and Scotland for completed council homes in selected years:
England Scotland
1970 130,180 34,660
1975 116,330 23,190
1980 74,840 7,490
1985 23,310 2,830
1990 12,960 1,630
1995 760 720
2000 180 110
2005 300 0
2010 1,140 610
2015 1,900 1,140
Source: Ministry of Housing, Communities & Local Government
This has resulted in the housing crisis (for example, see Financial Times, Shelter, The Independent, The Telegraph).
Why did UK local authorities stop building homes since the 1980s?
Although houses were built by local councils, funding came from the central government so the political decision to no longer do so was taken in Westminster. So the direct answer would be because they cannot afford to, but what motivated the political decisions stripping councils of money to build homes?
Although there's been some recovery in the past 15 years, building 2,000 council homes per year is far below demand. Scotland does a little better, it has 1/10th of the population that England does — per capita, Scotland has usually built more council homes, and are now building around a factor 5 more. Scotland does not have the right to buy, and has had more progressive governments than the UK (which decides for England), so either the right to buy and/or the more progressive governments may be part of the answer to the lack of council house building in England. I'm not sure how the right to buy would lead to lack of council house building; one might equally reason that the privatisation of council houses through the right to buy should necessitate a steady construction of new council homes.
Background reading: Tom de Castella, Why can't the UK build 240,000 houses per year?, in: BBC Magazine, 13 January 2015.