I wonder about that. It's been a while since I studied, but the phrase "deadweight loss" looms large in what I remember of the one economics class I took in college. So I wouldn't be surprised if the program is actually a net negative for job creation.
Only that doesn't matter, either, because the point is not to create more jobs; the point is to influence job creation in a way that benefits the people who hold the purse strings. If the cost of doing so outweighs the benefits, that's inconsequential. Those costs are so widely dispersed as to be invisible, immeasurable, and difficult to discuss except on theoretical grounds. They'll never be as compelling as a staged photograph of a senator in a suit and a hard hat, sticking a shovel in the ground.
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.
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.
It is not so different from subsidising farming (similar pros and cons) to ensure food security.
There is a lot going on in the supply chain that you need to maintain at a baseline level if you ever expect to have to fight.
From a very macro level whatever airframes get shipped may matter less than maintaining all the specialised knowledge and suppliers that you need to produce them. "Looking after the machine that makes the machine".
Concentrated benefits and diffused costs.
However, I think this does speak to your earlier point about politics. It's easier to get people on board with funding "health" (since everyone cares about their own health) than it is for "science"
My point is that politically none of that matters. No one is getting elected because people got to book telescope time for their research. The incentives are not correctly aligned to support research and science.
To go back to the F-35 comparison: the NSF has annual funding of $8.3 billion. The F-35 program is projected to cost $21.7 billion per year through its lifespan (2001-2070). I bet it winds up even higher than that, because nothing has yet changed to prevent endless overruns.
So the F-35 makes jobs and maybe a little bit of interesting work gets done as a result of the project despite itself. We as a society could buy so much more than yet another war machine (and maybe not even a useful one) with that money and effort. What could NSF do with another $13 billion every year?