This must have made the USA so much safer.
However, I think this question (and a lot of the crappy things about the US) exist to deal with and automate problems at scale. Scaling is hard. Scaling solutions are overkill if you don't have a scaling problem.
In this case, the problem is strong due process protections and allocating court resources. You might not hold a person without involving the courts if you suspect them of terrorist ties, but you can if they lie on a form or tell you they're a terrorist.
I don't know the specifics, but one could imagine a concession of due process if, say, the person held for their answer on the entry card is guaranteed to appear before a judge within three days.
Automate the process and you get silly situations like the one above. Don't automate the process and somebody eventually screws up and denies due process or lets a suspected terrorist through without scrutiny.
And again, yeah, the entry questions could be handled better, but it's a serious juggling act scaling it up and fitting it into our legal framework.
"Are you a terrorist?" -> "No, but I'm a soldier for The Cause..."
This question would likely weed out any wanna-be small time people intent on causing harm to the US. Something similar to how many criminals in the US are arrested due to routine traffic stops.
If asking this "stupid" question prevents 1 single undesirable person from entering the US, then it's served it's purpose.
Quaking in fear in front of authority figures might be the norm in the USA, but it is not the norm everywhere.
Best to learn not to argue with people with guns at the border.
(Somewhat tongue-in-cheek here but I actually do think this is the purpose of aggressive border authorities. As someone who traveled around old, pre-EU, pre-Schengen Europe, you used to see it quite a bit there as well. Hard to say if it was intentional or just the product of different training, though.)
Imagine how many non-resident/non-citizens enter the US daily. Now imagine if everyone of them were allowed to jokingly answer these questions. It would make doing their job that much harder.
It's much easier to treat all declarations as serious, rather than try to weed out the jokes. And because of the nature involved investigating, anyone who willing makes false statements are punished.