Two reasons for this. First, to make sure you are old enough to look at and/or buy any particular weapon. I looked at a pistol up the other day. The transaction as follows;
Clerk; Good morning sir, how are you.
Me: Fine, and you?
Clerk: Anything I can help you with?
Me: I'd like to look at that Ruger MKIII.
Clerk: May I see your drivers lic.
Me: I handed her my drivers lic.
Clerk: Mr. S I'll have to get another employee to show you the handgun, as I'm not old enough yet to handle them.
Me : That's fine
2nd Clerk: asked first clerk if she had my DL...she said yes.
2nd clerk showed me the pistol. First clerk scanned my DL.
Me: Why did she scan my DL?
Clerk: To verify that it was a real/valid ID. And we hold your DL as long as you are handling our firearms. We're had people try to run out the door with them, try to buy them with fake DL and and some not old enough to buy to begin with.
Then the clerk brought up the resident thing.
I bought the pistol I wanted, got my DL back and all went/is well. My data wasn't stored or nothing. It verified a valid lisence is all. When you buy a firearm, you enter more information on your federal form than your DL will ever contain!
Lets all just support our small businesses and TGO sponsors. The world would be a happier place!
Dave S