You're right that it is not necessarily efficient from a military effectiveness perspective. I see it as also an educational tool/investment. As other comments have pointed out, this helps the populace internalize their responsibities in war (affecting voting), might help instill social cohesion, and yes also provides a baseline military competency in the populace in the worst case scenario (total war).