"This isn't the entire story, a lot of government IT jobs are filled by people that know someone that know someone. It's nepotism to the extreme - "My nephew knows computers! Yeah, he fixed my screen saver, hire him and make him an admin or something". So you get arrogant novices without a disciplined approach to problem solving that give up quickly."
Things must be different where ever you are. I have never come across this in the government sector. It is shockingly common in among non-profits and unremarkable among companies that have recently made the jump to a grown up IT dept.
My experience is you find two types in the public sector: the young and green and the old and time serving.
The former are generally well trained, knowledgeable and enthusiastic to make things work. They are usually working for a fraction of what they would get in industry, either because they lack the work history to get a look in at a corporate HR dept, or because they think its a secure job (ho ho ho). Once the enthusiasm is beaten out of them by a combination of rigid systems, brainless management, budget cutting and people telling them that all public servants are stupic, overpaid and lazy they either bail out in favour of a private sector job or become job-hopping greasy pole climbers in order to escape into management.
The latter are often quite good on one topic - usually some obsolete system - but pretty useless if you need someone who can deal with anything later than NT4. They can be surly and unhelpful, which I think is a pretty normal reaction if you started what looked like a promising career 20 years ago only to have it tank due to factors well outside your control. Add a bunch of young guns who come and go talking about things you no longer even understand and the knowledge that at least some of those you started with managed to move on and up, but you are trapped until whatever system you know is retired and then you'll just have to hide in the toilets and hope no one notices until retirement day.
Basically, the same surly resentment of their own failure at life that in the general population led to Brexit, Trump and our own beloved One Nation party (known affectionately as One Notion around here). But I digress...
Where was I? Oh yeah, my experience of public sector IT, and the public service at the state level, is of well meaning and competent people trying to get things done in spite of their work environment. At the federal level morale and conditions have savaged to the point in some departments that the norm is now what the army used to call dumb insolence.