The tragedy of the Grenfell Tower block fire in London, which claimed an estimated 80 lives, sent shockwaves that resonated far beyond the British capital. High-rise apartment blocks packed with people feature in many city skylines. Growing populations, a shift towards urbanisation, and limited land mean that in building terms often the only way is up. But standards vary wildly and all too often we see it is the poorest and most marginalised that end up in substandard accommodations, sometimes with terrible consequences.

Exactly a month after Grenfell, three people were killed in another tower block fire in Honolulu, Hawaii. Here in Johannesburg we witnessed our own fatal tower block disaster. Seven people perished following a fire that broke out at Cape York Building in early July. Many others were injured. According to reports, one person died after jumping out of the building trying to escape the fire.

Johannesburg's mayor, Herman Mashaba, has offered his condolences as if this was some kind of unforeseeable accident. It wasn't. Like the case of Grenfell Towers, the risks were known. People are dead because they were poor and now with the building set to be sealed, others currently living in Cape York will be forced to move and so become further casualties of the fire. While the city has announced that it will offer support to the displaced, there is a shortage of alternative accommodation, making it unclear where people will be relocated.

Cape York didn't receive the same media attention as Grenfell Towers, most likely because the death count was not as high and the residents had been squatters, many having occupied the downtown building since the late 1990s. But it shouldn't take anyone's needless death to force us to focus on the social issues underlying both tragedies. Across the world's cities, many residents live in substandard conditions, mostly out of desperation. For too long local governments across many cities have allowed only market forces to dictate the kind of development that is taking place. All too often that is at the expense of low-income residents who are either pushed out of the city or forced to live in unsafe conditions. City authorities are failing to prioritise safe, affordable accommodation.

Research (pdf) into the supply of and demand for low-income accommodation in Johannesburg's inner city found that both availability and affordability were major problems for almost half of these residents, who earn less than $245 per month. The Socio-Economic Rights Institute found a household would have to earn about $440 per month to afford the cheapest formal rental available from the private sector.

OPINION: The connection between Grenfell and Finsbury Park

It's been about ten years since, for the first time, the majority of the world's population was to be found living in cities. This urban shift is going to continue, with a projection (pdf) that up to 60 percent of the world's population will live in cities by 2030. This means the demand for affordable housing will grow. Dumping the poorest members of society into substandard accommodation is not a solution.

China learned this the hard way. After encouraging cities to sell land to private property developers and abandoning social housing (housing provided by government, and in some countries NGOs, for low-income residents), political leaders were forced into an uncharacteristic backtrack when it became clear that a growing number of residents in its major cities were ending up in squalid buildings. According to reports, seven of the world's ten most expensive cities for residential property are in China. Prices are up to 40 times the average household annual income. Shanghai, for example, is one of the five most expensive cities in the world in which to buy a house, putting home ownership beyond the reach of most people.

More could also be done to compel private developers to ensure that a certain portion of their developments are reserved for low income households.

In an effort to confront the issue, in 2011 Shanghai rolled out an affordable housing programme. The programme offered alternative accommodation for people living in dilapidated buildings. It also offered a public rental housing system, low-rent accommodation and shared ownership homes. But the success of the programme was limited primarily because these interventions were not paired with a fundamental disruption of market forces through strong state regulation.

So the social housing project quickly became a money-making scheme. Shanghai's latest five-year plan (2016-2020) aims to do more to address property speculation and to increase current housing targets by 60 percent, making available 1.7 million new housing units by 2020. Of these, 1.25 million will be for the low-income market.

The provision of safe, affordable housing requires different approaches supported by well-crafted policy, strong implementation, and a variety of actors working together. One way for cities to address this would be to place a moratorium on all new developments, as well as the sale of prime land. State resources should be invested into securing some of these buildings and the land being sold off to use for a public rental accommodation programme; to provide alternative accommodation for those who need it and as sites for social housing programmes.

More could also be done to compel private developers to ensure that a certain portion of their developments are reserved for low-income households. But this should only be done in clearly defined circumstances, to ensure that city authorities don't simply hand over their responsibilities to private developers. There is another benefit of this approach. Beyond ensuring access to decent accommodation for low-income households, these strategies would also enable people of different classes to live side by side rather than in the class segregation we see in most cities today.

READ MORE: Out in the cold - The UK's social housing emergency

In addition, all low-cost accommodation must adhere to rigorous safety standards. Like in Toronto, Canada, where earlier this year a by-law was passed that will see landlords who face punishment for non-compliance. Property management companies and building owners must be held to account.

City authorities must stand up for their residents whose best interests they are meant to uphold. Municipal budgets will have to be re-ordered to support more social housing and affordable accommodation. They will also have to get tough on building owners, using legal tools, including expropriation, that are increasingly available to them. The benefits of changing how we approach urban housing will be seen in better lives, safe buildings and settled communities. That has to be worth striving towards. As we have seen in London and Johannesburg in recent weeks, the consequences of doing nothing can be deadly.

Koketso Moeti has a long background in civic activism and has over the years worked at the intersection of governance, communication and citizen action. She is a 2017 Aspen New Voices Fellow. Follow her on Twitter at @Kmoeti

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.