Depression can cause people to kill themselves; by itself it does not cause people to commit mass murder. That's a whole different mental illness, and one that good psychological testing arguably should have picked up during the hiring process.
Having said that, the argument that a second person in the cockpit is not really a safeguard against this kind of behavior- because a pilot bent on such mass murder would simply start with the person next to him - is flawed. It's one thing to change a couple of switches to cause a plane full of people to crash; it's another thing to batter a co-worker to death in a confined space. The mindset that can do the first is not necessarily one that will do the second.