True, but sometime their jobs make them piss off people who would happily order a hit on them. Under those circumstances I can see why they'd be less than thrilled to provide positive ID for a hitman...
If a cop is known to such a hitman by name then it's trivial to find him in the phone book, get to his house at night and do whatever hitmen do. (not that I remember many such events in real life, outside of books.)
If a cop is known by his badge number then it's probably a matter of a phone call (to thank him for salvation of your favorite cat, for example, or any other story) to find out his name.
If you are wronged by a cop then you may want to take his picture (to give to someone else.) But then the cop also knows you; this is not the case here.
But I don't see any scenario where a stranger would need to take a picture of an unfamiliar cop randomly met in the street. Unless the photographer plans to take pictures of all cops in the city, it's useless.
And besides, if anyone with half a brain wants to take photos of cops, it's much easier done by sitting in a car parked a good distance from the front door of the police department. Use a decent camera (not an iPhone) and you can photograph anyone from afar, the pictures will be good, and nobody will ever see you.
Then maybe they should be careful and engage in police work instead of "Click It Or Ticket".