Sanity is the ability to recognize right from wrong independently of private feelings. As the insane have no way of judging right from wrong except by their feelings, a simple test of sanity is the question:
How do you recognise right from wrong?
Unless the truthful answer is a traditional moral code (a religion), then insanity is demonstrated.
A Traditional Church
A moral code can only bestow sanity if the code is interpreted independently of the fears and fancies of the faithful, which tradition demands is by the church. And the ruler of the church cannot also be the ruler of the faithful, just as the ruler of the faithful cannot be the ruler of the church. The church can only be an adviser to the people and not part of government, otherwise it must become corrupted by self-interest. For example, as head of the Nazi church as well as leader of the people, Hitler had infallibility conferred upon him but not sanity, which made the Nazi regime insane and won disaster.