... as opposed to how you are compassionately honest and direct with people who can ruin your life-as-you-know-it based on which brand of bigotry pill they ingested that morning? (Clearly, this applies to many other aspects of life, not just international travel!)
Sure, insulting people behind their back is unethical. So is the treatment OP was subjected to.
It's not hard to be honest with people when I don't look down on them because they're not as educated as I am...
If an officer is being disrespectful and you dislike him, that's fine. If he's being disrespectful and you immediately think "Look at this idiot, if only he knew what kind of degrees I had" you've likely got a problem.