Yep, that's what's called an "Affirmative Defense". Per the state statutes this activity is perfectly legal as long you X.Y, and Z are present. And in this case they are. Therefore, the officers should be kicked in jimmies and off the force.
I think that enough lose everything they own, their nice pensions, and their jobs, then the rest MIGHT, just might learn what "To Serve and To Protect" emblazoned on the sides of their squad cars means.