As for defense spending, to be clear I'm all for swapping the pentagon/nasa budgets, but afterwards I'd still call bullshit if I think there's gross mismanagement at NASA. Pandering to the public with space-selfies is mismanagement, even if it's brought on by desperation and shrinking budgets. I think there's a strong argument Webb was also is bad strategy / mismanagement, but it's too long to get into here.
Unfortunately, like everyone else, NASA, NSF et al do need to worry about public trust, ROI, and the dreaded question: What have you done for me lately? There's this idea that basic research must be incompatible with that sort of thing, but I disagree.