Absolutely, governments should work for the people. Sometimes in order to do more for someone, you do less for them. There's a balance. Sometimes what you or the country needs is not what you want.
A lot of people don't necessarily want us spending a lot on military and defense, but we need to. By spending on it, we maintain the private industries even in times of relative peace so that when we do need them they're still there and we don't have to build them up from scratch again. It also becomes an expected necessary cost, so any other initiatives we try to fund have to contend with that part of the budget already being spent. This way we don't accidentally tie up what used to be military funding in all kinds of other programs so that not only do you have to rebuild production, but you have to sort out the financial problems too.
Governments make all kinds of decisions based on calculations from analysts, politicians, geopoliticians and so on. What people want is a factor, but not necessarily the most important one.
With our government shutdowns, congress and the president both have to agree on where to appropriate funds and how much funding to appropriate for the government. This funding has to occur, because there are critical programs that everyone agrees on, so there's actual pressure to get it passed. At the same time, there are other things that different representatives want to get funded or programs they disagree about and they'll leverage the pressure to appropriate funds before a shutdown or to shorten a shutdown in order to squeeze out decisions that are normally delayed/ignored.
That said, there is a critical culture in the US around hassling the government and not treating it as your friend. The government may work for you, but it is not your friend. Governments are bears. Do not feed the bears. Respect them, accepting their co-existence and the value they offer in an ecosystem, sure. Just don't train the bears to come to you when they're hungry, because some day you'll find that it's not a good idea to have a hungry bear in front of you.
Even though this is historically true and deeply wise, people find themselves steadily expanding the government despite the government being in debt. We also get people in congress that will vote no on almost anything, because they believe in small government with limited power and are concerned every time it expands.
So the shutdowns kind of happen as they haggle over these kinds of issues.
And this is just observing from very far, with the tiniest inconveniences like people not being given tickets for state parks etc.pp.
We had a thing with the Belgian government 10 years ago and basically everyone in another country was scratching their head.
I'm not hinting at everything being perfect here but you seem to be forgetting that governments should work for the people, not against them.