There is already a program in the military that allows non-citizens to openly serve with citizenship a reward for a good service record.
It always has been easier for them to gain citizenship. The US military have recruited from other countries.
However, this should not work for illegal aliens. I don't see how or by them lying on their service entry application.
There's always a background check that should have disqualified illegals from US military service.