It's the difference between ethics (codified laws) and morals (societies implicit laws). Society (in aggregate through our elected officials) accepts that as self defence for a police officer. Our laws could likely be used to prosecute him for murder (if the society that elected the prosecutor believed he should be).
* I am giving a perspective from how these systems _do_ work, not how they _should_ work in my opinion.