Yes, ALWAYS be polite, courteous, never raise your voice, never accuse, never question the rules, or if you have to, phrase it as, "I see, so, in that case, what is the proper procedure for me to do this?" rather than "this rule is stupid".
That's why it's so infuriating. You haveto act like a slave, being nice and courteous and considerate to someone who is abusive towards you, insulting you, accusing you, etc., and all the while you have to smile and respond as though they were polite. Eventually they'll chill out, and if you have your ducks in a row, let you through.
It shouldn't be that way though. Nobody should have to endure that, least of all those who are really are following all the rules, doing what they're supposed to, and have legitimate grounds for entry.
Note well that I'm complaining about the attitude and demeanour, I have no gripe with the entry requirements or processes in and of themselves. There really is a problem with the DHS, TSA, etc., agents, who seem to think that heaping abuse on travellers is a core part of their job, whereas their job really is searching, questioning, and checking, screening, etc., not insulting people.