If this incident happened at all and there is no law that prevents the picture from being taken, he should be fired.
As far as the dumb post about posting his picture on the Internet, he is not an undercover spy. He is a police officer. There should be no law to prevent his picture being taken in public.
This is not cop hating. It is anger over the abuse of a cop. I think a lot of people have had cops abuse their power and that is where this anger is coming from. The respect must be mutual, and threatening jail for taking a picture crosses the line big time.