To be fair, when I worked in my local library for a year, serving customers came first. If you were doing something else and a customer was waiting, you served them - even if what you were doing was for a customer elsewhere eg looking for a book for a reservation for someone in another library.
See I don't disagree with customers being served first (where practical, if I was the person waiting for you to do something I wouldn't be impressed to be made to wait for you to finish what I needed while you served half a dozen people who were "after" me in the "queue" just because they were physically there), if there wasn't already someone (or often two people) serving already and this person didn't want to wait in the 2 or 3 person queue that, being the cigarette/lottery kiosk, is usually gone in less than a minute. They wanted to bypass waiting at all by coming to someone completely different. And even when those of us at customer services do help out serving the kiosk queue, we pull the next person down from the existing queue, we don't just let people effectively "queue jump" by coming directly to us.
It annoys me too when people busy themselves with paperwork or stocking shelves or whatever when there's a queue. Sorry.
Not everyone who works in a shop has serving customers as their job. Just because the work in the store doesn't mean they are trained on a checkout any more than I am trained to use the warehouse equipment just because it is used in the same store I work in.
That's not to say some people won't do anything not to go on a till and serve customers but some people genuinely either aren't trained on the tills, if they're shop floor shelf stackers, or they have other things to do that are just as important
Today for example, I was working on the customer service desk and I had a constant stream of customers coming to me from around 1pm until 4:30 when I finally had nobody at my desk needing immediate attention ... the kisok queue was long but there were two people serving. I could have helped out their department, but instead I used the 15 uninterrupted minutes I had to catch up on my own job - imputting damages/faults in our system, updating customer queries, answering emails, answering phonecalls, imputting lost and found items, all things that are important parts of my job but had had to wait all afternoon untill I wasn't busy. Customers in the queue were getting served, they just had to wait a couple of minutes.