That only applies to legal immigrants with green cards. They can get expedited citizenship if they serve. Illegal aliens are prohibited from serving.
A prohibition on illegal aliens serving would make sense in the context that the military prohibits law breakers from serving. But if they were to return to Mexico and apply, I would think they'd have the same eligibililty as my Korean and Japanese friends who served in Nam.