Competent programmers are a dime a dozen.
Programming is the easiest damn thing in the world. It's so easy that children can and do easily teach themselves!
Sure, some problems are hard. Luckily, you can sometimes avoid them altogether. Go read some of Chuck Moore's work.
Anyhow, how do you judge the quality of a programmer? There's only one way that I know: by the quality of their output. But that can't be right, can it? Some of the most incompetent code I've ever seen has been written by programmers generally considered to be brilliant.
Take a chunk of code known to work correctly. It won't take you long to find one developer to say that it's brilliant, and another to say that it's total garbage. Why? The first developer either doesn't understand it or sees some clever or interesting tricks. The second developer sees it as unnecessarily complicated, the same problem being solvable with a much smaller, faster, and simpler solution.
If you'd rather: Perhaps the code is fine and solves the problem well, but the second developer would have approached the problem differently. Maybe they disliked the use of a specific language feature or technique, choice of brace style, or selected language.
Programmers usually aren't well versed in the humanities and tend to think in absurd black-and-white terms. They constantly mistake completely subjective judgments for objective conclusions. They're also prone to believe absurd myths (mistaking common wisdom for objective fact) and tend to buy in to the latest industry fads. You'll frequently find them defending statements that they obviously don't understand. They've simply never questioned their favorite meme. How could it be anything other than pure fact? Programming is like math, right?
Code quality is highly subjective, obviously. I understand that there are objective metrics like size, speed, and memory use. However, we can only use those to compare two solutions to the same problem! Even then, subjective measures (like readability) will quickly come in to play, which some people will consider to trump this or that objective measure -- particularly when two solutions are close on objective terms.
That absurd black-and-white / right-wrong thinking makes each person think that their subjective opinion is objectively correct, and thus irrefutable. What else can they assume but that they're surrounded by incompetent morons?
Do you know who writes bad code? Everyone. The best developer you know wrote crap code last week. You wrote crap code last week. I wrote crap code last week. Not you, you say? You used the latest set of buzzwords? Remember this: Yesterdays best-practices are today's obvious mistakes. Sometimes they oscillate between bad and good. Pick damn near any topic and dig through both current and old articles and blogs to get a sense of how the common wisdom changed over time. (Nonsense "design patterns" are an easy mark. You'll find lots of back and forth on many of those.)
There are other reasons, of course. A big problem seems to be developers over-complicating problems. Sometimes going so far as to write an interesting problem that solves the problem they've been tasked with as a side-benefit. I replaced an 81k (1700 line) component with an 8k (300 line) component a couple weeks ago. Was the developer of the old component incompetent? Not at all. He just made the problem significantly harder than it was. I'd guess that it was to keep the otherwise dull project interesting -- or because he found the problem space interesting and wanted to explore it.
When I see stuff like this I can't tell if it's arrogance or just insecurity.