I know it's not required by law to scan it, but it might be a store policy, in which case I don't think there's a law disallowing that kind of store policy. They'll tell you to shop elsewhere, and every big store does it.
The only law involved is the one that penalizes them harshly if anyone underage manages to buy liquor. If fake IDs are less likely to pass that scan, maybe that's why they do it.
I'm sure it's CYA for the stores, but then they're holding copies of your license and doing who knows what else with it. I've been seeing more of it getting rolled out, but so far I just present my license if they ask for it, but don't relinquish it and tell them I don't want it scanned. So far it's never been a hard line. I did it yesterday and the cashier just shrugged and I paid.