The judge could have thrown it out on the basis that the notion of "separation of church and state" does not exist anywhere in our Constitution.  It is merely a philosophy that is binding only to those who wish to embrace it.  It has no foothold in law.