What sort of insane logic is at work here?
The U.S. is a country ruled by law, and the federal government is an anal-retentive regulatory machine. There is probably a rule somewhere that says entry is to be denied for the mentally ill, and that depression is a mental illness. It's not up to whoever stamps passports at entry to decide or make personal judgements - if the rules say the person can't enter, then they can't enter. This is no different than any other rules applied - be it corporate accounting, environmental protection, labor laws, etc; it doesn't matter how ridiculous it may seem on the ground, the rules will be enforced.
This is exactly why it's the only government in the world I'd trust to obey the law. It's also exactly why it's incapable of even building modest insurance retail site for less than half a billion dollars - because its regulatory system isn't compatible with the need of reality.
Once something is made law it's no longer in the domain of common sense and judgement. Laws are binary; either you're in compliance or you're not.