Law enforcment: really invariably bad outcome of joking in security matter?

It is my impression from reading press reports over the years that making labored jokes in the presence of law enforcement/customs/security types in the vein of

will get the hapless joker in deep shit, like being detained and questioned for a long time, getting person, belongings and vehicle searched very thoroughly indeed, being treated/prosecuted as someone uttering a bomb threat etc.

Now I’d assume that a rational person involved in actual criminal/terrorist activity would not draw attention to himself by this kind of behaviour, and someone making a bomb threat would phrase it as an actual bomb threat not as the opposite of a bomb threat as in the first example.

So my question to people familiar with the law enforcement mindset is: Which of the following explanations apply?

[list=a]
[li]Null hypothesis - The original premise is faulty; obvious jokes-in-bad-taste of this kind are often dismissed as such as a judgement call, i.e. the book not thrown at the joker.[/li]
[li]CYA - as the repercussions on the officer dismissing a ‘joke’ would be too awful in a case where the ‘joke’ wasn’t, the officer cannot risk making that judgement call.[/li]
[li]psychology - bad guys often don’t act rationally but rather act out e.g. with this kind of ‘joke’ when the rational course of action for them would have been to shut up.[/li]
[li]Irritation - this kind of bad joker being informally punished for the unofficial crime of Being An Asshole[/li]
[li]other[/li][/list]

Anecdotal evidence from talking to many friends who have crossed the US-Canadian border indicate that it is a multi-dimensional continuum, with many more elements than you have listed–current political climate, type of car being driven, attitude of the officers/border crossers, whether or not some of the crossers seem to be Native American, presence of unconscious people, visible weapons, time of day, weather…

Re: air travel, IMO “d”.
Airline passenger screening is not for the purpose of providing security, as much as it is for the purpose of creating the appearance of providing security. Adopting a hardass position that stupid jokes are inherently dangerous acts that need to be prosecuted merely serves further to intimidate the herd.

I think the answer is mostly B. If an officer overhears a remark about a weapon, there’s really no choice but to investigate. I can’t imagine that “Yes, I heard that person say they had a knife, but it seemed like they were joking, so I didn’t check it out” would fly if there did turn out to be a real threat.

B is why, but D is a fortunate by-product

What I’ve heard is that the customs/airport security people are required to take all comments seriously. No matter how obvious the joke is, they could get fired if they don’t drop the boom on you.