I think there is a more important nuance here you are missing.
Policing attracts people. And then those people get surrounded with the absolute worst assholes and bullies there are out there. They arrest them. They fight them in the street. They hear decades of stories from their fellow officers about the shit they have endured. And then, when they do catch a bad guy, and he gets let off with a fine and "time served", they realize the system is just fucked up, and they are powerless to do much about it.
So now you have a self-proclaimed "good guy with a gun", and you send him specifically into bad situations with "bad guys", and tell him to fix it. And then don't support him after he does that job.
While there are good guys in senior roles at every police department, who have weathered the storm and kept their humanity, there are far more that haven't.
Ever been to a policeman's barbeque at his house? Nope. Because you aren't a cop, or the wife of a cop. Their job is so stressful, and so shitty, that they ONLY hang out with other cops, because they don't know how to socialize with people who don't see the shitty side of the world the cop sees every day.
It is a fucked up system that takes good people with good intentions and turned them into jaded assholes who just want revenge against any perceived "bad guy" they can get their hands on.
(Sources: Friends who were cops. Dad worked with police forces, too. And I have a close friend who is a therapist for cops and works with them after they shoot someone.)