They aren't enforcing the law. They're managing their risk as a business, by not doing business with people who could put them at legal risk. If they were "enforcing the law", they'd send you a fine for tens of thousands of dollars and throw you in jail if you didn't pay it.
If a gun store owner knew a guy was buying a gun to shoot up a school, wouldn't you want him to refuse to sell it? Wouldn't you want to hold the gun store responsible for knowingly enabling illegal activity?
(Note that I am using gun analogies in my comments because I feel the positions here are oddly tied to a specific issue, and hypocritical when applied to others. I'm aware these aren't really similar in severity by any means.)