It’s a funny comment because I think you could also argue that the government misappropriated a huge amount of public money to put a man on the moon in the 1960s, when it should have invested that into medical research or better transportation infrastructure in America. The fact that the private sector hasn’t developed moon travel yet is a sign that it’s just not that important to most people, not a lack of productivity.
Or maybe that the return on investment is data they can't directly commercialize. Though I guess they could auction off pieces of the moon to the highest bidder or something of the sort. But yes I think we can all agree that that money could've been better or at least far more efficiently spent, same goes for the US's colossal military budget. This is in a nutshell the whole mindset behind the EU's spending the way I see it - social programs first, science second, everything else third.
Enjoy it while it lasts. The EU countries have only been able to under spend on their militaries because of US security guarantees. That subsidy is coming to an end one way or another and they are rapidly increasing defense spending. That means austerity for social programs.
In terms of novel drugs introduced per year (not just repackaging existing drugs), the EU as a bloc is consistently behind the US. So, their scientific spending doesn't seem to be paying off in pharmaceuticals.