I will always treat the checkout personnel politely, as long as they are polite to me. I have a tendency to mirror their behaviour - if they are very silent and don't say anything to me, I often am the same. If they are rude, I will point out that there is no need to be rude. Most are polite and friendly, which is fine. But if they are going to act like checking out my groceries is a massive pain in their bum, then they're most likely going to get a comment from me about it. I have had employees make comments on things we were buying that were rude as well, and I won't tolerate that either - I will speak up, as it's not appropriate or professional.
I don't believe that the customer is always right, as obviously they are not. But I do believe that if you are in a job that is customer-facing and service based, that you need to present a professional, polite, and friendly appearance. It's part of the job. It's easy to be friendly and polite to most people anyway. But I think it's important to remember that some customers may seem quiet or distant because they are distracted or thinking about something else, and a friendly hello may make a difference. I know that over the last week after my dad passed away, I've been to the supermarket a couple times (distracted, forgot a couple things) and I'm sure that while I wasn't rude, I wasn't really friendly, just quietly going through, not smiling, just trying to focus on "get stuff packed, pay for it, get out before bursting into tears in front of anyone." The employee may have thought I was being snobbish, I suppose, as I didn't really speak to her, but it was self-preservation at that point - get through and get out, IYSWIM.