A few possible reasons. Being a citizen may have such great benefits that they cannot afford to let just anybody in, especially the rabble that would just live on the government teat forever. The military service may be the price to ensure no layabouts try it, you have to actually risk your life to immigrate and do ten years of hard training and labor to get in. And they only take the relatively young and healthy, they aren't going to be a retirement community for elderly immigrants that want to live off the excellent government retirement system, use the free hospitals, etc.
Another reason is their social welfare systems are very attractive, their land provides enormous wealth, but they need a large army to protect it from predators, and their own pampered citizens are not much interested in volunteering for it. So join the military, if you live through it, you are set for life. Ten years now is not a bad bargain for 50 years of leisure, especially if the rest of the world is also dangerous.
My father took that route in the USA, in the early 50's, he joined the military at 17, retired at 38 with a good pension for life, free healthcare and access to very low cost non-profit base facilities, including the grocery store, pharmacy, movie and numerous other entertainment facilities, even free legal services.
And perhaps the nation is even altruistically expansionist; their ultimate goal is to convert the world, take over the brutal dictatorships by force, when they believe those other countries are enslaving and brutalizing their citizens. Perhaps enticing those citizens to immigrate to them, and then overthrow their previous government, is a strategy. Sometimes the best defense is a good offense.