The criteria that the IRS uses to define a religion for tax exemtion purposes are seriously screwed up anyway. Here they are, just for reference:
a distinct legal existence,
a recognized creed and form of worship,
a definite and distinct ecclesiastical government,
a formal code of doctrine and discipline
a distinct religious history,
a membership not associated with any other church or denomination,
an organization of ordained ministers,
ordained ministers selected after completing prescribed studies,
a literature of its own,
established places of worship,
regular congregations,
regular religious services,
Sunday schools for religious instruction of the young,
school for the preparation of its ministers.
Pretty much only mainstream Judeo/Christian religions can meet this description, but the IRS realizes that there would be serious constitutional issues if it excluded Quakers because their meetings have no prescribed character or officiating minister, or Buddhists because they don’t have Sunday schools, etc.
The rules exist so that the IRS can have some legal basis for excluding flagrantly fraudulent organizations, but because of the unwieldy nature of the rules and the inconsistency with which they’ve been applied, they’re extremely vulnerable to legal challenge. And the Scientologists have demonstrated that they’ll throw all of their considerable legal muscle against any challenge.