That's the title to a Volokh Conspiracy post. There is actually a court case in Arizona on this question. Eugene Volokh aptly sums up the court's opinion: "Not for secular courts to judge, holds the Arizona Court of Appeals."
James Madison said the very same thing in his Notes on the Memorial and Remonstrance. That he didn't want courts of law making these judgments was a strong motive in driving that document.
Below doesn't quote from the Arizona case but Madison's aforementioned Notes:
3. What is Xnty ? Courts of law to Judge.
4. What edition: Hebrew, Septuagint, or Vulgate ? What copy what translation ?
5. What books canonical, what apocryphal ? the papists holding to be the former what protestants the latter, the Lutherans the latter what the protestants & papists ye former.
6. In what light are they to be viewed, as dictated every letter by inspiration, or the essential parts only ? Or the matter in general not the words ?
7. What sense the true one for if some doctrines be essential to Xnty those who reject these, whatever name they take are no Xn Society?
8. Is it Trinitarianism, Arianism, Socinianism ? Is it salvation by faith or works also, by free grace or by will, &c., &c.
9. What clue is to guide [a] Judge thro' this labyrinth when ye question comes before them whether any particular society is a Xn society ?
10. Ends in what is orthodoxy, what heresy. Dishonors Christianity.