I think the point is it's not the parking infraction: it's the attempt to get out of it by signaling that they are a police officer. I agree that kind of thing should be taken more seriously than the small offense it's trying to avoid (though maybe not quite so severely).
I don't know, it depends on context and intent, like nearly all things. But this is put aside because most on HN immediately go: police == bad.
If the cop is illegally parked to get lunch, sure ticket them, and/or report them for discipline.
If the cop is attending an incident and that is the only place to park within a reasonable distance, then that's fine.
However the suggestion that irrespective of context and intent, and even for the first contrived example, the cop should lose their job and pension... Ridiculous.