Well, an arrest is not the same as being convicted of a crime. There's no way for airport security to know whether you were joking or mentally unstable and dangerous, and it's reasonable that they detain you whilst they find out.
Of course, it's not like a psychopath could lie convincingly so that he could proceed with his evil plans, so I guess they can't actually let anyone in, ever.
Sure, sometimes someone is suspicious because he's actually up to no good. But that doesn't mean detaining people on various subjective suspicions is a good idea.