While good overall advice, I understand that those protections do not cover you at the border. As an American entering the US, yes you just need to provide a customs declaration. As a non-US person, it's not clear what rights you have. They certainly don't need to permit you entry.
The other guy does not have your interests in mind. He knows the rules better than you, and knows which rules you probably don't know and what he will get away with when bending the rules. He's probably not specifically out to get _you_, but he's definitely being measured on his "performance" by whoever pays him, and that means he's highly motivated to "get" enough people, whether or not it's deserved. Anything you say is less likely to convince him of your innocence than it is likely to give him more ammunition to use against you.
Make both of your lives easier - firstly don't do anything wrong, secondly answer any questions he has with the briefest possible truthful and polite/respectful answer. You'll get waved through, and he'll move on to the next talkative and/or disrespectful person and give them a hard time. (For those of us who aren't US citizens, remember it _is_ a privilege to be permitted to visit, a privilege the possibly minimum-wage customs/immigration/border people on the ground have the authority to revoke.)
"For those of us who aren't US citizens, remember it _is_ a privilege to be permitted to visit, a privilege the possibly minimum-wage customs/immigration/border people on the ground have the authority to revoke"
This is a libelous accusation. The US Government doesn't pay its employees minimum wage. Those border police make more than engineers and programmers on average.
https://www.youtube.com/watch?v=6wXkI4t7nuc
"Don't talk to Police"