Why would the Navy want this mentally-ill man to serve in uniform?
Maybe this person does a really good job. Being nuts doesn’t mean incompetence, though being on hormones the body was never meant to be on is bound to affect one’s judgement. But they lack evidence of such until they try dealing with it for a while.
Recruiting may be so weak in recent years that they can’t just take the cream of the crop but rather have to accept whatever floats in. Most of the officers grew up watching Klinger on MASH and most of those they’re enlisting now grew up on Star Trek, so eccentricity is not the recruiting turnoff it once was. In the new anything goes normal the old Hornblower normal may be considered disruptive and undesirable.