If this guy was suffering from depression, no background checks or security measures would have filtered him out. Depression is a civilisation disease, caused by the fucked-up society we have created around ourselves, the non-stop pressure, the endless competition, the constant message that you're not good enough that everyone is sending to everyone else. The artificial fear for survival that our governments create to drive wages down and create the economic pressure that corporations than exploit to get people to work under conditions that our parents would've scoffed at.
The solution is not in more pressure, the solution is in making a society that is made for human beings, not for robots, stock markets, the goddess of economic growth or any of the other crazy things that we're sacrificing millions of lives to.