The Police are (for the most part) doing what they're told! They don't write the laws nor do the really understand them either! They're there to clean up the mess after the crime...or they're part of the crime!
And according to the SCOTUS, they aren't required to enforce the laws either, yet they do, some of them, and usually badly.