What systemic failures can lead to tragedies like stampedes at religious places, and how can governance be improved to prevent them?

The recent stampede at the Haridwar temple has raised concerns about systemic issues. I want to analyze what weaknesses in the system contribute to such incidents and how governance reforms can enhance public safety.