Standing in Line Is a Coordination Problem
It does feel like a form of work.
You come to the DMV. You stand in line. You wait 20 minutes. Eventually, it's your turn. You get to actually do your thing. Unless your thing is applying for another number for which you yet again wait some more.
There's no way around it though. There are strong societal norms against cutting the line: you are just not more important than everyone else. If I put in all the work of standing here, why do you feel entitled to get things done ahead of me?
However, the fact that you, as a person, should not try getting around an existing line does not mean that the existence of said line is normal and acceptable. In fact, we should be more upset about them existing.
What are they actually good for
To be fair, they are not all bad. In fact, if demand for a service can vary in time, having some lines is useful to even out the demand and not waste providers' time, waiting for someone to show up. If you have, for example, multiple cashiers at a store, you either have some of them sitting idle sometimes, or some of the customers will end up waiting for one of them to free up. You also want to be more or less fair to customers: processing customers by arrival order likely makes more sense than just allowing the most pushy ones ahead. Self-arranging ourselves into a line-like formation serves the dual purpose of keeping track of arrival times and being around for whenever processing capacity is ready for us.
What they are not very good for
You can also use lines to hand out a finite amount of resources to people, taking into account how much they want it. For example, in theme parks, if you really want to get on a ride, you'll stand a line for it. If the line is too long and you don't want it enough, you'll just go somewhere else. This way people who actually get on the ride are likely to be the ones who value it highly, since they were willing to burn more of their lifetime on standing in line for it.
There is an interesting "proof of work" mechanism here, similar to that of Bitcoin. By actually standing in that line, you're demonstrating that you're not double-spending that piece of lifetime on something else; it is hard to fake, therefore it's an accurate measure of how much you truly value the experience you're waiting for.
The end result is still entirely ridiculous though. There is a nice park which you could walk around and have fun in... and yet: you observe large amounts of people standing at places they clearly do not want to stand at, purely for resource allocation purposes.
(To be fair, this makes the job of the park much easier, keeping people in. Otherwise, they might end up finding that the nice park is in fact a lot more boring than what they imagined.)
What they are not good for at all
Take lines at airport security. There are some airports where they are always pretty long. Of course getting people through security is a lot of work, so lines have to be long, right?
These lines are not useful for resource allocation purposes though. After all, it is relatively rare for people to decide that they are not getting on the plane because the line is too long and it's not worth the wait. No matter how long the line is, they are going to get through it.
Furthermore, if the line is never empty, it is not helping with "buffering" either. Imagining an infinitely long day, you could make almost everyone's waiting times slightly shorter just by temporarily adding one TSA agent for half an hour in the morning, and then going back to the original capacity all the way after.
Of course, you can make money by making things selectively worse! Are these lines long to make TSA Precheck more popular? (It's probably on the side of conspiracy theories, but not entirely unlikely regardless. Even if it's not entirely on purpose, it is plausible that long lines are not being explicitly fought against.)
Solutions?
Noticing the problem itself is a good first step.
Are you waiting on your turn because if you weren't ready to jump in, the valuable resource would have its time (that's worth more than yours) wasted? (Think "it's almost my turn waiting for this restaurant".) This is okay; carry on.
Are you waiting because this is the only solution you have to collectively remember arrival order? Actually, humanity has developed a range of solutions to this. For example, restaurants nowadays have lists on tablets in front that you can sign up for; they'll send you a text whenever they are ready, allowing you to wander around instead. Some of them allow you to do this online too; you can just show up when it's your turn.
Is the thing you're waiting for so valuable that this wouldn't even be an adequate mechanism? That you need to demonstrate the high value you're attaching to it? And adding a signup system would be useless, because there would be just lines forming hours before waiting for a moment when the signup system opens...? (Seen this happen with university course signups.) Well, humanity has solutions for you too. E.g.... "money". Just auction them off.
After all, "money" is supposed to be a pretty robust and hard-to-fake signal towards what you value most highly. If there is long lines for your product, you're just not charging enough.
Bringing up "university courses" as an example will probably evoke some objections in many people. After all, isn't this just a recipe for the rich kids get what they want, even more times than they typically do? And get ahead in life? Get even richer? Etc?
First of all, if your goal is to get as much stuff to as many people as possible, "money" might still be a good strategy. The rich kids paying for the fanciest course, by the most famous professor, would gladly pay extra. Some of that money can go to pay the tuition of the poorer kids, so that they can still attend a decent class, basically for free. By turning away their payment & inflicting standing in line on them, outcomes might be more equal, but also just... worse, for everyone involved.
Meanwhile, for your exclusive and non-scalable resource... if you truly want to select the people who are capable of enduring the most pain in the form of standing in line, regardless of wealth, you can just invent a system of inflicting pain quickly and efficiently instead.
Or, if we are not insisting on "pure pain and wasted minutes of life" we can introduce entrance exams! They are, occasionally, not much less painful, but might actually select more worthy people, vs. line endurance levels.
(isn't it also cool that you can find the random bread box you took a photo of 10 years ago, on google maps? With only, um, little over half an hour of staring at street view? Totally worth it. Especially under a post about efficient use of time.)