The first consideration here is that this is a movie only and Hollywood presents things that aren’t logical or realistic 9 times ouf of 10. That being said, here is a more genuine explanation of the incident:
The key factors in this equation are that the supposed suspect in this scenario (even though Samuel Jackson was the sociopathic neighbor) had his back to the cops and they were behind him. This means that he didn’t pose an immediate threat because he was not directing any hostility toward the group of police officers.
Now, as far as Samuel Jackson was concerned and here is the key element even though he was a policeman himself, he was armed with a gun, facing the other cops and this was posing a direct and deadly threat to them. This is a deadly force scenario and if a perpetrator refuses to drop his weapon after he’s repeatedly been told to do so, officers might have no choice other than to use deadly force to subdue the suspect and end the situation.