If you say that someone is as sane as a
judge, you are saying that he/she is in good mental health and can
think and behave very rationally. This idiom comes from the fact that judges decide who is either sane or
insane in a court.
Son who thinks he's insane when he's not:
Dad, considering my mental health
issues, do you think I'm insane? I'm kind of worried.
Dad: That's not true, my son. I wholeheartedly believe you're as sane as a judge.