Maybe there's necessarily not all that much benefit, at a national level for any given country. Though some might benefit. A large, rich country can afford a space program, a poorer or smaller country might put the money to better use elsewhere.
Making claims about space benefits in general is missing the point: a given country can purchase space services from elsewhere (say weather sat reports or crop surveillance). Even launch services for your own country's satellites are widely available. And tech breakthroughs from space are mostly available on the free market.
On the other hand, a country with a large engineering and scientific base may very well benefit from building competency in the space domain.
And some countries may not find it easy, or a good idea, to buy space services off-the-shelf: China's aim to be great power precludes that and North Korea isn't going to be able to buy it.
So it really depends and that's also a bit like building your own military hardware: there's only place for so many national space programs that bring something new to the table rather than being me toos. All the more if you want to sell launch services - those are hugely competitive, on cost and reliability metrics. That's especially true now that rocket tech is evolving so quickly - even established players like Arianespace are being put under pressure, doubly so the Russian program.
But it's not like countries are never known to engage in prestige projects - that's why the term "white elephant" was invented after all. You see this time and again in advanced fields like car manufacturing, jet airliners, etc... Those are rarely obviously a waste in a well-run country, but they still happen.
At another level, there's opportunity for a nice lil bit of space pork too: NASA's SLS for example is years late, billions over budget, will cost ma$$ive per launch. How many Webbs could have built with it? But it will doubtless be defended tooth and nail by lobbyists and congress people: you can mix worthwhile and wasteful programs within the same country.
Last, rather than going all in on your own space program - your own spaceports, your own launchers, your own satellites and deep space probes, you may very well reap good benefits from participating in collaborative programs with others - there's ample space to do so.
(Even though this is a political forum, it doesn't seem unreasonable to discount political reasons, in order to discern if citizens and taxpayers are being sold a dud, for political reasons).