I think a potential motivation for investing in megascale engineering projects is right there in your comment — military advantage. If humans do manage to colonize other planets it seems inevitable that there will eventually be wars (cold or otherwise) that involve many billions or trillions of people spread over multiple planets or star systems. An ongoing conflict on that scale seems like a great reason to develop a Dyson swarm — we don’t know what kinds of weapons would be involved in a war like that but it’s a safe bet that they require enormous amounts of energy. The first Dyson swarm may well be the result of a dick-waving contest with mass drivers instead of ICBMs.
Just think, a military entity with the population and resources of NATO or the Warsaw Pact would have been totally inconceivable just a few hundred years ago.