Actually, I think the best thing we can learn from the military would be how to organize and mobilize large numbers of people toward some goal. The same could be said for religion. Then it's down to choosing a good goal...
I've pondered what would happen if we could dedicate one weekend per month of sports to community improvement instead. Where I grew up, sports were a big part of life. Every weekend the many fields and venues were full of people working together (and competing). Just imagine if they could all be organized to put their energy (just one weekend per month) into goals that would benefit everyone in the area. Perhaps military command structures and communication processes could be of value here...
Of course not. Forcing people to volunteer is... not effective long term.
Anyway, I long since left that Texas city which gave me the idea. I know amateur and professional sporting happens all around, but I don't encounter it much (so I forgot about the idea until now). I'm onto other things, although I still think this is a good idea. I know some churches organize their members to do good community services periodically, so I don't think it's a stretch to imagine sporting communities to make a routine of doing the same.
Along these lines, there's a lot of hearsay that the technology that enabled JWST's mirrors, sun shade, etc. to be folded up for launch and deployed once in space had already been developed for military satellites.
Nobody knew at the time that Hubble was literally a KH-11 class telescope, but one pointed the other way. The mirror size and the ability to be carried in the shuttle was probably to get some synergies out of those two projects.
"Accessory to War" is a pretty deep take on this topic.