One part of it is probably guns: even in states with strong gun control, there are plenty of them in the hands of hoodlums, so voters appreciate the Dirty Harry approach to dealing with them.
But to me that doesn't quite explain why cops seems to have such semi-formal impunity (see for example http://marginalrevolution.com/marginalrevolution/2018/01/get..., http://marginalrevolution.com/marginalrevolution/2018/01/pol... and http://marginalrevolution.com/marginalrevolution/2018/01/pol...).
Of course we can guess various reasons, voters like police, cops stick together etc, prosecutors and police work together etc. But those things are true in other countries too.