The real problem is the very concept of a Government trying to define what it, and what is not, a religion. It is akin to attempting to argue what makes up Doctor Who's canon. What makes up my Doctor Who canon is not what makes up your Doctor Who canon. This is quite true for religions too. What I consider a religion, others will not. Some might consider certain religions as a "cult" whilst others just don't think it is a religion at all. Such arguments have raged for years and not just on small New Religious Movements like Scientology. Confucianism and Buddhism are both hard to define as a religion and even some adherents wouldn't describe them as one. Even some, mainly born-again, Christians will swear blind Christianity is not a religion but is (depending on who you ask) a "faith" or "a personal relationship with Jesus Christ".
And if one cannot truly define what is and what is not a religion it does seem somewhat silly to attempt to give religions tax breaks that other groups and organisations cannot expect.
The court's decision was the right one in allowing Scientologists, no matter how ridiculous one finds their beliefs and how dangerous one might consider church practices, to marry in their orgs but one would hope that one day someone will finally tell the emperor that he has no clothes and stop the whole nonsense that is attempting to define a religion in law.