And why are there so many poor ones? Because there is no punishment for being a poor coder in most companies. It has been documented at least since Fred Brooks 1st edition of "The Mythical Man Month" that there is at least an order of magnitude difference between good coders and bad ones. (Actually, IMO, that is also true for good architects and good PM's.) But -- in the last 30 years, are the good coders rewarded and the bad ones punished? No.
As to why that is...I think it is because IT is viewed as a cost center. Therefore all executive efforts are on cutting costs. Managers have to follow that lead. Rationally, if the people who contributed to good projects were retained, and people on failed projects (say, after your third failed project you're history) were canned, over time the good people would be retained and the number of failed projects would go down. But I have never seen any company attempt to perform any long term analysis on projects to start producing working systems and reducing the number of failed projects. I suppose there are a few, but I have never seen even one.
I've been fortunate to work on a few projects where the profit was evident. On those the old make it work and work no more applies. Great joy to have things work and be appreciated. But a happy maytag customer isn't buying another washer for awhile.
That blindered thinking "a cost, not a profit making asset" is not just in IT. Can occur anywhere. Does. Very strong in IT, though.