Unfortunately, TSA checkers have no discretion: they're supposed to behave like robots[1]. They're not allowed to write off a wisecrack as a joke, but are required to take it at face value. (Even though no sane terrorist would joke about smuggling a bomb through a TSA checkpoint while in the queue at said checkpoint.)
TSA response: warn people that they can be arrested for joking.
Possible solution #1: figure out why people are making jokes (boredom, long queues) and do something to fix it, reducing the incidence of false positives. (Hire more bodies, shorten the queues.)
Possible solution #2: recruit higher quality security guards and train them to use their initiative, then give them some discretion. (The El Al/Israeli response.)
Possible solution #3: reform US foreign policy to reduce the inflammation that causes terrorist activity against US targets; focus on intelligence-driven police tactics to prevent terrorist attacks before they get anywhere near an airport or other target: abolish the TSA. (The utopian solution. This won't happen because, politics.)
[1] A large subset of the American population believe that government can do no good. Therefore government agencies are not allowed to operate as if they're staffed by competent, intelligent human beings with discretion. This is why we can't have nice things.