Consider why sports exist. They are also a (cultural) byproduct of military endeavors. Sports bring us a variety of benefits, including things like giving people meaning, making them bond with each other, helping maintain a healthy lifestyle, and lifting many kids out of poverty. There is a role for something like that---for exploring places like space. Consider also human (primate) psychology and how team sports can satisfy urges we would otherwise want to unleash in more destructive way on each other---and do so in a positive, constructive way. I wouldn't be surprised that in an alternative timeline where sports don't exist our newspapers would be filled with a lot more grizzly headlines on a daily basis. Consider now that we're living in an alternative/dystopian timeline where one of the most fascinating sports (exploring the unknown) had mysteriously nearly disappeared. Purely as sport, space exploration would have been of a sufficient benefit to pursue in my opinion. But of course, it is a lot more than just a sport.
One actually could argue such. Being able to permanently and self-sustainably inhabit space means being able to reduce the strain on Earth's own resources, thus reducing the need to compete for said resources (said need being a major contributor to plenty of wars, both current and historical).
It's a stretch, sure, but it's still an argument one could make.
Going to into space and making something of yourself rather than grabbing a gun and killing each other like rats in a cage?
I think it's something that came out of industrialization in the late 19th century. Look at the famous football clubs, they're all founded late 1800s/early 1900s, in cities. Basically guys who needed some entertainment on the one day off that many countries had instituted by then.