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?
Issuing or denying a permit could easily have millions of dollars of impact. Nobody in their right mind would agree to take that kind of personal responsibility without a proportionally high profit.
If a cable tech steals something from your house, is the cable company liable, or the cable tech?
Edit: a similar doctrine should (but doesn't) apply to decisionmakers at large corporations. If the CEO is told repeatedly about a safety failure and refuses to take action, it's ridiculous to me that the CEO isn't personally liable for any damage or injury caused as a result.
The problem is this whole qualified immunity is a civil thing. Workplace safety negligence, theft, police violence all are criminal cases. But. After the the prosecutors (DAs) stopped charging police officers people started suing them in civil court.
The problem is not QI per se, the problem is _wtf_ is going on with cops killing anybody in non-violent cases. (And how come there's not a public inquiry when someone dies in law enforcement custody or during any interaction with police. And how come nothing has really changed over the years - except police got the old tanks from the post-9/11 war-on-terror spending spree.)