This is extremely common at major bars in most states in the US, especially if you're anywhere near a college. It's there to detect fakes. I'd imagine fake IDs are a much larger problem in the US, however, given that the drinking age is 21.
That said, at least years ago, the ID scanners would operate on data stored on the card and not make any network connection to a database. So then more expensive fake IDs began to exist that could scan fine. Then, I think some bars started getting more expensive ID scanners which actually do talk to some database.
Some bars and nightclubs use ID scanners for verification purposes. A machine vision system is much better than a bouncer at spotting fake IDs or knowing what a Latvian driving license is supposed to look like. The scanner can also check names against a list of banned patrons, which may be shared between venues.
This isn't quite true. Since the licenses can be valid for a long time (e.g. ten years) there are still europeans with valid old-style licenses. Until I renewed mine last month I had a ridiculous paper booklet with a photo glued on.