No. It's often difficult to see whether someone is mentally ill or not. Besides, psychopaths are notorious for deceiving everyone around them as that is what they've been doing ever since they were little kids. Goes for personality disordered people in general anyway. Psychopaths and narcissists do everything they can to uphold a certain image and they will succeed in doing so. I don't know what was wrong with this guy, but screening for mental illness is tough. Furthermore one can be mentally sane when entering the army and become ill at another point in time.
As a last point: if you're declared insane, you're still punished. And in a lot of cases the punishment is actually more severe, in the sense that they can do whatever the hell they want with you. You're declared a danger for society and put away in an asylum for years. Not good. What is claimed to achieve freedom is temporary insanity. The succes rate of such claims is extremely low and escaping punishment on those grounds rarely happens. The man will be punished.