The problem isn't a few bad apples, it's a culture that allows a few bad apples to expect impunity and protection from the consequences of their actions.
First they inflate your ego by telling you you're joining a high and noble cause.
Then they tell you that others don't appreciate the noble work you do and they hate you for reasons out of your control. And you just want to do right in the world so that's not fair!
Then they show you every documented instance of when an officer was ambushed and/or killed. This forces you to mentally ostracize yourself from the broader community by instilling a persecution complex.
Then they teach you that only your buddies in the department have your back and everyone else is out to get you.
Then they train you literally to shoot first and ask questions later. This training consists of variations of the game "slaps" except you're drawing a gun and shooting it at the other player instead of slapping the other player's hands.
And at that point you've been shown (1) that you have a huge target on your back, (2) how to pre-empt a perceived attack, and (3) how to justify the use of force or defend your fellow officer for doing so.