The answer in all cases is simple.
Our minds don't work rationally in stressful and tense situations. That's why we drill (and beast) the young men who join our armies - so that they don't have to think under pressure. Self-preservation and fear are so baked into our evolution it's surprising more mistakes aren't made - we are the way we are because those who ran first or killed first survived to work out later whether that was the right thing to do and pass those genes on.
So you have undertrained police (nobody's fault here - I don't know how you can fully train for this kind of pressure) who believe when they arrive at a scene that there's a chance they'll get shot at, under immense pressure and they make a snap decision. Bear in mind that Police in the US are currently going to work knowing they might be under sniper fire.
In the overwhelmingly large majority of cases, when police pull a gun on a suspect they make the right decision. In a tiny, tiny proportion of these they make a wrong one.
From a quick Google search, there are nearly a million police in the US and in high crime/violence areas they can pull their guns a few times a day at least. So let's reduce that to account for the police in places where there's no crime and they probably never pull a gun - let's say one gun pull per officer per day. That's 365,000,000 gun pulls a year, and in 2014 (most recent years I could find accurate data for) 100 unarmed shootings. You should also bear on mind that "unarmed" in that 100 includes people trying to take weapons from an officer, those pretending to have weapons, those charging at an officer, trying to run them over in a car, etc.
So overall (obviously this is very rough but it gives a good sense of scale) an unarmed person is killed in 0.000027% of officer gun pulls in the US. That kind of number doesn't square with me when trying to present a racist, murderous police force.
Then once the press and people who want to make a point on the Internet make up some reasoning of their own you have a news story.