Have you heard of opportunity costs?
About war: in our universe we got the first digital computers because of military efforts during the second world war. However, without a war IBM and Konrad Zuse and others would have gotten there, too. With much less human suffering.
I believe you are making the same argument: the GP prefers space race over war for large technological development at less or no human suffering.
What opportunity is being lost out on because of space exploration?
You are serious? Up until this point I thought you're writing in jest, because all the things you mention are actually good ideas - including especially funding manned space flight from entertainment budget, because:
1) It's better aligned with mission profile (inspirational, emotional, but not strictly necessary;
2) There's much more of it to go than NASA gets;
3) It would be a better use of that money than what it's currently used for.
Now do the opportunity cost of AI model virtue signalling to investors for several years
Firstly how is this related to opportunity costs. Secondly, no one said that to create digital computer you should start a war. It's just that war is already present, regardless of you invent digital computers or space travel.
It's unlikely computing would have developed as quickly as it did without the Cold War. IBM's Sage and MIT's TX0 were both Cold War projects - one for a national early warning system, the other as an R&D platform for flight simulators.
Most US investment in associated tech - including the Internet - came through DARPA.
Not pointing this out because I support war, but to underline that the US doesn't have a culture of aggressive government investment in non-military R&D.
NASA and the NSF both get pocket money in budget terms. And at its height Apollo was a Cold War PR battle with the USSR that happened to funnel a lot of of money to defence contractors.
The original moon landings were not primarily motivated by science.