There is also the issue that there is no reasonable alternative to the police.
I can't name very many things that the police don't have an alternative for, actually. Even when they're supposed to be doing their jobs, my own anecdotal experience has been that they don't actually do that. A friend of mine got jumped a few years ago by three guys and the cops wanted to arrest him for demanding that they go arrest the other guys because they didn't want to arrest said guys. Why? It was inconvenient for them.
But they stopped long enough to flirt with his mom.
Reading online about police response to protests and protesters its fairly clear that the police believe that they are doing the right thing in all these cases. That's why (kinda in a mobster like fashion) they don't testify against each other and almost invariably got each other's back. The core issue remains that the police are doing exactly what they are trained for. Minorities in the US get the brunt of it but the fact is that it can happen to anyone.
You're so close to realizing the police is just a racist institution. Like, they believe the right thing is upholding the law. So what happens if those laws, policies, and mandates are racist? Like, what if minorities get the brunt of it because those laws, policies, and mandates are racist? What if, from conception until this very date today, the laws that get cited and protested, the actions of police in and outside of protest situations - what if those were all racist?
The good news is you don't have to wonder the what if - all those laws, policies, and mandates are, in fact, racist. Like stop and frisk laws, for example. And everything that came out of "The War on Drugs".
The bad news is that they are racist, and always have been, and it's incredibly messed up.
The entire police force needs to be demilitarized and retrained into not thinking they are batman. Otherwise you will simply continue to have police that is doing exactly what it was trained to do.
Abolish the police and replace them with something else entirely. Same thing with prisons, completely remove the prison system and replace it with a system focused on rehabilitation.