1. The "broken windows" fallacy taken to its extreme:
> The broken windows theory is a criminological theory that states that visible signs of crime, anti-social behavior, and civil disorder create an urban environment that encourages further crime and disorder, including serious crimes.
https://en.wikipedia.org/wiki/Broken_windows_theory
Police see themselves as the "thin blue line" between chaos and social order, and believe that they must put down and resistence, immediately, decisively, and violently.
But, this is a fallacy. In NYC, for example, major crimes fell when the NYPD stopped is "proactive policing" policy.
https://www.latimes.com/science/sciencenow/la-sci-sn-proacti...
2. Militarization. The police are no longer trained to "protect and serve;" they're trained to occupy and battle. They see citizens as the enemy, and treat them as such. They are being told to "dominate the battlespace," which is what you say about an enemy you want to destroy, not a community you want to protect.
This extends to their equipment, as well. There are too many SWAT teams, too many tanks, too many tools of violence, and when you have those tools, they will be used. Part of this is because of government budgeting - if you don't use it, why should they give you more money - and part of this is because we have fetishised violent police action.
A lot of this started with COPS, but "police being action heroes" is an entire genre of reality TV now. You can find videos of the police officers gleefully destroying buildings because a suspect might be inside.
3. Personal immunity. Police face no repercussions for their actions. If a police office targets the wrong house, tosses a flashbang into a baby's crib, and shoots the mother ... nothing happens. There is no justice, there is no recourse. Police are violent because they can be violent, with impunity.
This is driven in large part by police unions, who make it essentially impossible to fire a police officer, even for the worst behavior.
4. Personality. The job of police officer attracts the kind of person who should not be a police officer. People who want power over others, people who want a license to use violence, simply cannot be trusted with that power.
This issue is greatly compounded by the above points; if you take someone with violent fantasies, give them military grade weaponry, teach them that their neighbors are an enemy who will murder them with the slightest provocation,and tell them that they will never face any consequences for their actions, what do you expect to happen?