Deterrence. Having your ID on file (vs knowing only a name that they likely made up) makes a potential criminal much more likely to get caught, so they're much less likely to do anything bad.
It's still another barrier that deters people - it's a numbers game, not about impossibility.
And even a forged ID would have a valid photo that looks like you, which is much more helpful in finding a suspect than simply eyewitness/victim testimony.