This is a big part of the problem. If you give the F-35 program $1 billion and you give the NSF $1 billion dollars, the F-35 program is going to directly generate more jobs. They pay people less, and they need more unskilled labor. The NSF needs very little unskilled labor, relatively speaking. Scientists are expensive. Machinery for science is crazy expensive (although so are a lot of F-35 components). Machinery for science also often involves buying foreign parts, such as the replacement cables for Arecibo that were coming from Germany.
One way for the NSF to address that is by requiring parts to be US made like the DoD does. It will increase the price, and it will often result in less effective parts (as it often does for the DoD), but you can make an easier argument that cutting NSF funding will take away jobs. I don't know if that's a net win or not, but it would probably get them more funding.
As another example, I wonder if Wisconsin's sweetheart deal with Foxconn actually had a negative impact on employment. Clearly Foxconn's promised jobs never materialized, but the threat of them coming to town to spend big money may have had a chilling effect on existing or prospective new employers in the area.
Back to the F-35 program, the jobs it creates may be deadweight, deadend careers that don't produce real value. And then you can't just have these people unemployed and starving, so I guess we'll need an F-35+1 program for them and their descendents. And so on forever, until we break this cycle.
Versus something else that you could buy with the same money that has a future and does create real value (like say, solar panels?). But you're right, its just about the perception of jobs and that photo op.