This mentality comes from the “warrior” and “killology” training methodologies that many, if not most of, US cops follow. They basically are convinced that they are warriors in a warzone, and any suspect or perpetrator is their enemy. They treat everyone as if they had a gun and are trying to kill officers.
This CNN video gives a decent example of some of their training, and helps explain why US cops are so scared and eager to shoot at everyone and everything.