I agree it could have been better spent. Or worse spent.
$10 Billion is 1% of a Trillion. Our Annual Budget in 2021 was $6.82 Trillion. So this $10B expenditure was .14% of our Annual Budget. That is if this old man did the math right.
On the other hand, NASA's Annual Budget is $23.3 Billion. So they spent 43% on this project.
Not arguing one way or the other. Simply trying to put this in perspective.
Actually, the costs are more favorable than what you've posted; the cost for Webb was spread out over 20 years. Nasa's budget is 0.5% of our annual national budget. Webb averages just 2% of that 0.5% annually.
General comments (aka my opinions).
Compared to all the other wasteful spends of money at the government level, spending monies on projects like Webb is exactly the sorts of things our government should be doing. Science and defense; the sorts of things we as individuals cannot match for ourselves.
Webb can lead to discoveries regarding the nature of the universe, help solve the unified theory that Einstein was unable to resolve. This in turn can lead to solving the world's energy problems, space travel, etc. It is a stepping stone to the next level.
Webb is the sort of STEM project this country needs to do more of. Advancing humankind for the sake of advancement. Discoveries made will fuel the imaginations and inspire young boys and girls who will be responsible for solving the problems of tomorrow. We don't have enough kids interested in STEM to keep pace with other nations long term.
Though most or all the discoveries will be shared in full with the rest of the world, having Webb as the development of a western democracy demonstrates that we as a nation are still a force in the geopolitical game.
And yes, we should take care of our own planet but having options is good. Ask the dinosaurs.
I know, I pin a lot of hope onto this kind of project. Hopefully it all goes well and we get these kinds of return on the investment.