If religious doctrine governing the affairs of a religious corporation is inconsistent with the provisions of this chapter on the same subject, the religious doctrine shall control to the extent required by the Constitution of the United States or the constitution of this state or both.