In this case the system as a whole worked because it violated religious freedom. But obviously the first judge's ruling followed some principle of allowable judicial interference. Based solely on what he thought he was allowed to do, what's to stop a judge forbidding parents from giving their children cheese? It doesn't violate the first amendment...
no subject