We just need to make builders more liable for issues caused by their own building. Building codes are just a way to say, you won't get in trouble for bad things that happen, in return you have to follow these rules every time you build a house. Instead if we just say, if you build a house that kills someone, you are now a murderer, then yeah I think the markets can figure out how to not get people killed. But that's…
After all, it's a simple enough matter to start a new company, trade for 3-5 years, pay yourself some big dividends then declare bankruptcy and start a new company with a very similar name and set of employees.
Furthermore, the construction of larger buildings often allows for a merry-go-round of blame shifting. The architect specifies fireproof material 'or equivalent', the main contractor outsources parts of the design to specialist suppliers, the specialist suppliers trust marketing materials, the material manufacturers had small print saying people should run their own tests, the specialist fire consultant didn't raise the alarm about a change but he stopped getting paid a third of the way through the project, the contractors thought the building inspectors were checking for safety, the building inspectors thought they were a secondary safety net and responsibility lay with the designers... and so on.