Hoo boy. How much time have you got?
The fundamental problem with NASA is that one of its main functions is to serve as a pork funnel to send money to key congressional districts. This goal is, as one might imagine, sometimes at odds with NASA's other mission of, you know, exploring space. When these are in conflict, the former wins. In the private sector there is a similar dynamic, but instead of the pork funnel tail wagging the engineering dog, it's maximizing profits that is the primary driver.
So what happens at some point in everyone's career is that they are given marching orders that serve the financial goal but not the technical ones and they have to decide what to do. If they raise objections they are labelled as "not a team player" and they don't get promoted. So the ranks of upper management are filled with people who are willing to play the game while the troublemakers are shunted off onto career sidings and turn into grumpy old men with no power or influence.
In my case I found myself in a very bizarre situation for two reasons. First, I had credentials that were visible outside the organization. I was a researcher with a pretty good publication and citation record (in fact, according to CiteSeer, I was the most cited CS researcher in all of NASA, and I held that title for about ten years after I left). That made it hard for them to fire me. And second, I had a patron, a senior manager who liked me and got me promoted over some pretty strenuous objections. So I ended up on the highest rung of the technical career ladder, essentially untouchable. But I had also made some powerful enemies. So what happened to me was that my funding dried up.
A small digression: the process of funding research is largely a sham, though I didn't realize it at the time. Ostensibly, people write proposals which undergo peer review on their technical merits (though of course what really happens is that the money is assigned based on which congressional district your institutional affiliation is in). One of the weird things about NASA research proposals is that you have to tell them what results you are going to achieve, which is kinda weird because if you know that ahead of time it kinda stops being research. Also, as part of this year's proposal you have to tell them whether you accomplished the goals from last year's proposal, and that goes into your score.
I came up with what I thought was a clever way to game the system: I wrote proposals for work that I had already done, which insured that I would always be able to provide accurate predictions of the results. It turns out that everyone does this, but I didn't realize it at the time. So one year my proposal was rejected on the grounds that what I was proposing was too ambitious, that it could not be done on the budget I was requesting. Which, of course, I knew to be false because I had already done the work the previous year, but of course I couldn't say that. It was only many years later that I came to realize that the reviewer already knew it too, but that this was a not-so-subtle signal that I needed to toe the party line.
But I didn't, so I found myself being assigned to projects that had some extra money in their budgets to cover my salary but where I was essentially a potted plant. (I spent an entire year shepherding purchase orders for search appliances through the procurement system.) Towards the end I was spending my days in an enormous windowless office by myself with literally nothing to do. That's when I quit.