As a non-American who works in the US and crosses the border often, there is more to this.
Sure, if you just came back from Afghanistan/Pakistan, are carrying sketchy items in your luggage, etc, I wouldn't be terribly surprised that you had to go chat with a friendly customs agent just to be sure you're not trying to blow anything up.
That's not what happened though - and despite the fact that this is purely a one-sided telling of the story, I've had sufficient dealings with CBP to suspect that it is most likely entirely true.
The author was harassed, verbally abused, and treated in an entirely unprofessional manner. The customs agent was out for blood/witches and gave up all semblance of professionalism and reason. This is extremely typical of my experiences with CBP.
The most hilarious thing is that most customs booths I've come across have had a big "we promise to treat you with professionalism and courtesy" poster from DHS emblazoned on it. I've never seen professionalism out of that organization - it's either complete and utter apathy, or (if they smell blood), complete and utter belligerence.
The fact of the matter is, CBP agents treat every single traveler as guilty before being proven innocent. Every slight deviation from the norm is treated as proof positive that you're a terrorist. Every denial and scrap of evidence you have is merely treated as a smokescreen from your true guilt. I swear, to work as a modern American border guard probably implies complete sociopathy - I'm not sure how it'd work otherwise.
CBP is an embarrassment to America. If all we ever saw of American was, well, the first people you meet at the border, I'd never want to visit. As a non-American I'm certainly not in a position to fix this, but for the Americans out there, please fix this. This is one of the many reasons why America enjoys such a dubious reputation abroad, and needs to be fixed. The author here is an American citizen - the treatment foreign nationals get is considerably more blood-boiling.