The original laws of this country did not permit lawsuits against government employees acting in an official capacity. After the Civil War, the Civil Right Act of 1871 was passed allowing citizens and residents to sue government officials for civil rights violations suffered under color of law. The qualified immunity doctrine was created by the courts after that to shield public officials from nuisance suits for discretionary actions (generally meaning bureaucratic actions) by people angry over actions that went against them (i.e., for denials of licenses, judgments, etc.).
Unfortunately, due to the volume of nuisance suits, this doctrine got stronger and stronger over time. At some point, the courts began applying this strengthened doctrine intended for bureaucratic actions to police actions.
But why shouldn't all people be protected from nuisance suits over reasonable mistakes?
Under the centuries-old principle of sovereign immunity, the government can simply choose not to be liable for anything at all. Sovereign immunity is the default for most countries now, and throughout history.
The US and the countries of the EU are relatively unique in allowing themselves to be sued for damages for their failures.