Also, this government funding supports fundamental innovations that private companies wouldn't fund because it's too general and too far from monetizable. But after those breakthroughs happen funded by public research, private industry benefits enormously. This includes most health and medical advances and the science underlying most technological advances. So government funding doesn't conflict with the work being necessary or important, on the contrary, it is possibly more important long-term.
Disclaimer? The government funds some of my research.
The PMs are generally chosen from the sciences, and are responsible for authoring RFPs that meet strategic goals, and negotiate with the PIs (grant recipients) about terms and sizes and such.
So there are really two political realms, above the funding agency, and underneath, and its entire function is reconcile those worlds in a pretty vague way with a certain amount of autonomy given to the PM.
This isn't 100% great, but if you have good PM, some good science does get funding. While this seems like a lot of machinery, if you short circuit all of it, and have the presidents direct flunkies make funding decisions, that basically means that almost no real science gets done.