Something that a lot of anti-Police activists don't understand is that when a criminal decides to shoot at Police, there is nothing else they won't do. They've got nothing to lose, they've decided to cross the line into a world they can't come back from.
When an Officer is shot at, they are obligated to return fire. That suspect is now a much greater threat to the general public and must be stopped.
Of course there are guidelines in place for protecting civilians from power hungry cops. But in this case, the Officer did what he needed to do to protect and serve.