First of all, let's make sure we look at the full scope of civilian life with a sober eye. Anyone working the counter at your local Post Office could easily work the register at any grocery store in your town. And any medium to large company has plenty of internal politics. Don't make the mistake of comparing the worst case of government to some idealized notion of private enterprise.
Second, take a look at what happens to people who do leave the government. Very often, their salaries go up in the private sector. This is especially true for specialists like the folks who work at the NSA. Seems like they can hack it.
Folks who have not worked for the government, or very close to it, have a hard time comprehending the fundamental differences between government and private enterprise. For one thing, when you work for the government, many rules of your job carry the force of law. Being too flexible might not just get you fired, it might get you prosecuted.
And there are so many rules. I'll give you one example scenario: a person leaves their job, and a subordinate steps up, takes on their workload, and does great.
In a private company, you'd just promote the subordinate. You already know they can do the work, you retain institutional knowledge, and it's easier to hire junior positions. Efficient and effective.
But in most federal agencies that would be illegal, as it might permit some form of corruption. The subordinate would have to keep doing the extra workload, while the supervisor requisitions a new position to replace the old one, and then runs a (highly regulated) open public application process. The subordinate can apply too, of course.
This is not because the supervisor is some terrible inflexible or dumb person. The rules are just stricter and more burdensome in the government than in private enterprise.
Why? Because everyone loves to believe the worst about the government, so it's easy to sell voters on the necessity of a shitload of burdensome rules.
So: if you want people to act smarter in the government, you have to give them permission to act smarter. Firing has little to do with it. You have to give people the opportunity to try things and make mistakes in good faith.