I disagree as to the cause. NASA's issue is NOT pay, NASA's issue is that it's been caught by the bureaucracy, and I know because I saw it firsthand.
Back in the day, NASA projects were urgent, so the rules were suspended. You could order parts and get them without going through government regs.These days it's months and months as it goes through channels.
Then there's the obsession with safety. "Failure is not an option" is killing NASA. I worked on a test satellite for them. The flight team came in at the end and said we couldn't fly it. We asked why, and they said some of the components in the satellite hadn't flown before. I exploded! If we can't fly new components on a test satellite, when could we ever fly them?! Things are somewhat better now, but that was the way it was when I was there.
And then there was the HR lady who came in and told us that all us white male engineers would never get a promotion until we got to a gender and racial balanced department. Like that would every happen. I left soon after that.
These days, being an engineer at NASA is little more than being a glorified project manager. It's the contractors at JPL and the like that get to do real engineering and that's because they don't have all the government red tape tying the employees' hands. Don't get me wrong, there's still more red tape dealing with the government than IBM, but contractors don't get all the crap that government employees get stuck with.