A lot of the HR analyses I read on HN are coming from an extremely privileged position and are very US-centric. What you experience in the very few tech hubs in USA is absolutely not what you'd experience literally everywhere else in the world. This is an observable fact if you speak with a lot of non-US contractors. But it's also a fact that's usually not welcome on HN.
Most managers I had in my career were indeed morons in general: self-centered people optimizing only for their quarterly or annual bonus, very plain slave-drivers whose only difference with the real thing is the lack of actual whips, unable to understand simple concepts as "a good manager removes obstacles, they don't roast people", and never able to actually lead and not just cover their own bottom by shouting at people to not miss an impossible deadline, and always seeking to inflate their department's budgets out of fear for their budget to be not reduced the next fiscal period. All of that with very little regard for the actual product and success of the company.
Was it my fault for working with them? I suspect yes. But then again my formative years were filled with fear and dread to not end up living under a bridge (very rough and rocky start in life; don't ask). This has made me blind to my own negotiation power and I made many mistakes during most of my career. So strictly and mathematically speaking -- yeah it was my fault for tolerating morons. But once you control for fairly often-occurring human traits (like a beaten-down psyche) you can very easily see what a huge amount of programmers out there are either too afraid or too burned out to seek a better environment. This is often made even worse by them sticking to one market (country or a business area), too.
One truth that a lot of people hate hearing is: if somebody detects that you are vulnerable in any way, they'll make it their goal to turn that against you. There are plenty of such piece of sh1t people out there and many of them are HR or managers. I know this doesn't conform to the touchy-feely world view that many have and that's why it's not a popular thing to say.
Glad your own experience is the opposite. Wish mine was too because overcoming the negative inertia comes with a very real cost on your soul -- and you have to, every day, consciously and carefully, override your subconscious mechanisms. It's extremely tiring. Two years later I am just barely starting to have the right instincts during negotiations and have to measure every word to not put myself in a crappy situation. It started getting better, yes. Took a damn long time for it to even start happening though. Wish I met kind people who saw that in me and were willing to go out of their way to help me overcome it. I wish.
How you are brought up in your early periods (in this case: start of career, not literal childhood of course) makes much more difference than many are comfortable with admitting. Sure, at one point I inevitably realized this is exclusively my problem and it's me who has to fix it and reverse its negative effects -- and I do that. But it's not an overnight change, and the transitional period can be extremely hard. I know it was for me.
---
TL;DR -- yeah a lot of managers out there are morons. Can't claim a percentage obviously, but tons of personal anecdotal evidence combined can make for a decent statistical evidence IMO. And you can't counter one anecdotal evidence with another while claiming that yours is somehow the better source of truth. A lot of programmers out there will without hesitation say "most managers I ever worked with were morons". Your positive experience does not nullify theirs.