If that's reasonable, I'd hate to see unreasonable.
Not 100% sure that it was illegal. If you walk out of a retail store and set off those alarms, they do not have the right to search you. They do have the right to detain you iff they are holding you for the cops to get there (it becomes illegal when they detain you without calling the cops). This can vary from jurisdiction to jurisdiction, but in general I believe this holds true.
Though I believe that the TSA should be held to a higher standard in their jobs (retail employees/managers are not trained to deal with this sorts of issues, at least not well).
Jobs like TSA screeners often attract a certain type of person who revels in the chance to exert authority over others. It probably delighted this Bardmass fellow to no end to put this stuck up traveler going on about his "rights" in his place.
How many people were bullied into ceding their rights before Mr. Bierfeldt took his stand? A system that simply waits for TSA employees to overstep their bounds and then corrects them may be better than just letting them set up their own little fiefdoms, but lets make sure to remember that it could be much, much better by simply educating TSA employees about the rights of the passengers and proactively making sure that those rights are protected.