AIUI (I don't live in the US so their may be errors in this)
To issue notices to register for the draft (there is no draft in the US at the moment but registration is still required in case there is one) you need two things, firstly a list of people with their addresses, secondly a list of people who have already registered for the draft. Then they can take the people who are in the first list and not in the second list and send them notices.
So the question becomes where to get that list, why the DMV well it's kinda simple.
1: most people drive and hence are issued driving licenses by their state's DMV
2: driving licenses are used as ID cards
3: you have a minority of people who don't drive, these people nevertheless need some kind of ID card, the states decided that it was simpler to have the DMV issue ID cards to people even if they don't drive than to set up a separate ID card department.
So the DMV database is the closest thing to a "database of all people in the state" that is readily available.