You multiply the cost of prevention by the risk of a crash and see if it exceeds the cost of a crash.
Some plane crashes can be prevented with a $0.30 warning light. Preventing those plane crashes is optimal.
Some plane crashes can only be prevented by permanently grounding all planes, because they'll be caused by a confluence of improbable events. Trying to mitigate every implausible circumstance that could potentially lead to a crash is not optimal, even when some of them proceed to actually happen.
I suppose you could let the market decide, and just have airlines publish their failure rates, and more process means a higher ticket price. But it's a bit grisly.
It is grisly, but the role the government has here is in setting reasonable liability numbers for a life, currently somewhere near $750K on average in the USA. On top of that there are putative penalties (sometimes including criminal) for negligence beyond current accepted standards.
> I suppose you could let the market decide
People think of the market as just involving the principles, but in practice you actually get a ecosystem of controls, between insurance companies, vendors setting standards beyond the normal risk of consumer litigation. The tradeoff is really one of how many specific procedures are specified top-down by government, or required by your insurance company (which may in-turn require something like third-party certification). In-practice plenty of the private regulatory regimes can provide just as much protection, or even better protection for the public as governmental review. They can also be worse. But they do tend to be nimbler, and also tend to leave more room for experiments and risk takers on the margin.
Some plane crashes can be prevented with a $0.30 warning light. Preventing those plane crashes is optimal.
Some plane crashes can only be prevented by permanently grounding all planes, because they'll be caused by a confluence of improbable events. Trying to mitigate every implausible circumstance that could potentially lead to a crash is not optimal, even when some of them proceed to actually happen.