That's what happens when you let the inmates run the asylum.
Programmers are fools, for the most part. They don't understand what problem they're really trying to solve. We thought we were solving a cost-of-production problem for a fully scaled business. That wasn't the problem. The PROBLEM was NOT DYING. And that meant getting a working product out the door as quickly as possible, even if it cost more.
That's a little harsh. I think it's fairer to say that they often don't have insight into the wider strategic objectives of the company, and that's as much a company failing as anything. I'm now a firm believer in sharing e.g. revenue numbers with everyone in the company and explaining why they're important - people are much more willing to accept things when they understand the wider picture.
You get tired of writing a pile of code that solves the problem the wrong way, so after 10 or so iterations of un-appreciated or un-used code, you learn to try to look at the big picture instead of always trying to isolate the problem into a fun programming exercise.
There is a management lesson here in being sure the right people are working on the right stuff. If you may need process improvement to generate the nightly reports by the next morning, don't send someone who loves to re-implement scripts in C. Or, if you're the person who loves to re-implement scripts in C, realize that your prospects may be limited.
No, of course not. It's by showing/encouraging more ways to hack a solution. Writing code is one of many tools that can be used, and as the adage goes: "if the only tool you have is a hammer, everything looks like a nail." You can't pick the best tool for the job if you only want to use one tool.
I don't mean to suggest the perception of code as just one of many means to an end is wrong either; it actually makes perfect business sense. It's something managers need to understand. But in your "enlightenment" you've forgotten what made you tick in the first place - how do you translate your new business-value-driven mindset to something the people under you (who don't have that mindset) can appreciate? Hint: it's not by telling them their cool hacks are useless. And we wonder why programmers distrust management.