The military is already open to foreigners and has been for some time. For those who complete their service honorably citizenship is available to them.
Right now the military is open only to legal permanent residents (green card holders) not illegals.
http://www.usimmigrationsupport.org/military.html
I'm not really opposed to opening up military service to those who wish to become residents and eventually citizens, but I'm not sure how you set up an objective system of who you would accept and also limit the numbers so we don't get a flood of recruits with questionable allegiances.