No prior arrests or convictions or outstanding warrants. Never committed to a mental institution or judged mentally deficient or incompetent to handle his own affairs. Never failed a drug test that was reported to legal authorities. Never dishonorably discharged from the military. A citizen and in the country legally. Not a fugitive. Never tried to renounce US citizenship. No restraining orders or record of family abuse. Result = he passed the test.
If there was a flaw in the system, it's that rejection by the military, possibly for a failed drug test, apparently doesn't get reported to the FBI system. Beyond that, though, they aren't going to keep track of everybody who's ever acted crazy. There are too many of them, deciding who's crazy can be subjective, and there are a lot of lawyers and civil libertarians who'd mount challenges to such reporting, judging, record-keeping, and denial of rights.
Years ago, though, when Arizona's population was a lot smaller and people knew each other, you could suppose that it would get around that that crazy kid from the college tried to buy a gun and perhaps he wouldn't have been sold one. In a much larger and more impersonal world it's hard to turn away a customer like that. Chances are the vendor doesn't know anything about the prospective customer, and there are always other stores.
If he was making threats and people knew and no one reported it, that would also be another failure in the system. With a conviction or a restraining order on his record, he wouldn’t have been able to get the gun.
I think that the store where he purchased the Glock is called Sportsman’s Authority, and the manager was quoted as saying that the FBI check came back immediately, that he was cleared to buy the gun in no time at all.