A judge’s public manifestation of approval of invidious discrimination on any basis gives rise to the appearance of impropriety and diminishes public confidence in the integrity and impartiality of the judiciary. A judge’s membership in an organization that practices invidious discrimination creates the perception that the judge’s impartiality is impaired.
 An organization is generally said to discriminate invidiously if it arbitrarily excludes from membership on the basis of race, sex, gender, religion, national origin, ethnicity, or sexual orientation persons who would otherwise be eligible for admission. Whether an organization practices invidious discrimination is a complex question to which judges should be attentive. The answer cannot be determined from a mere examination of an organization’s current membership rolls, but rather, depends upon how the organization selects members, as well as other relevant factors, such as whether the organization is dedicated to the preservation of religious, ethnic, or cultural values of legitimate common interest to its members, or whether it is an intimate, purely private organization whose membership limitations could not constitutionally be prohibited.
 When a judge learns that an organization to which the judge belongs engages in invidious discrimination, the judge must resign immediately from the organization.
 A judge’s membership in a religious organization as a lawful exercise of the freedom of religion is not a violation of this Rule.
 This Rule does not apply to national or state military service.