The problem probably lies with the pressures of business, if you can get away with writing inefficient software it means you can get away with hiring less skilled developers, paying them less than a competent developer, and compressing project timelines to the point where refactoring and optimisation just isn't a thing that happens.
Over in FOSS-land, Software tends to be a hell of a lot more efficient, without the pressures of a restrictive budget, the software developers tend to do their due diligence more often.