There are some states that permit anyone over 18--regardless of legal status--to obtain an ID or DL.
Some would say it's better to have illegal aliens with a legitimate DL (on the assumption they pass a driving test) rather than risk the incident many years ago in Temecula, CA where a coyote was running a batch of people across the border and when they got to the I-15 checkpoint in Fallbrook/Rainbow (just south of Temecula) the 16-year old Mexican driver got spooked, blew through the checkpoint, was chased by the Border Patrol, crashed into a schoolbus and killed several kids.
Others say it provides more security to prevent them from having a DL which, let's face it, is used for a lot more than just proving one has permission from the state to drive a car.
Here in CO they passed some law that requires a person to be a US citizen or lawfully present permanent-resident alien in order to get a DL. Before the law went into effect, they said there was a rash of fake/fraudulent documents being presented to DMV! So now they've gone Draconian in that a <pet peeve> United States passport IS NOT sufficient proof that you are a citizen and thus eligible for a DL!!

We are in El Paso County. A guy here said his wife couldn't get a DL from the local county office because she was born in El Paso, Texas and when she presented her birth certificate, the no-nothing DMV weenie assumed it was some kind of forgery and refused to issue her a DL! She wound up having to go to a state-run office and languish in line for 2 hours to get her DL.
Security guru Schneier:
"REAL ID also prohibits states from issuing driver's licenses to illegal aliens. This makes no sense, and will only result in these illegal aliens driving without licenses -- which isn't going to help anyone's security. (This is an interesting insecurity, and is a direct result of trying to take a document that is a specific permission to drive an automobile, and turning it into a general identification device.)"