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.
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.