... did constitutional law even come up in the last page or two? Saw the word mentioned like twice, and most of the discussion didn't really have much to do with it. Y'all seem to be talking more about what's allowed as evidence, and maybe a bit of judicial inconsistency, not anything about that particular sort of law.
In any case, vis a vis it being a religious ban, the reason the EOs can be called that, and (iirc, it's entirely possible I'm misremembering exactly what got the first struck down, and what's going to get the second one, too) part of the reason they got squashed, had little to nothing to do with the body of the law itself, and everything to do with comments both explicit and otherwise by the people making it. Not lawyery enough to quote exactly why that's involved, but it is so *shrugs*
As for the tax loophole thing, I'd bet a fair amount of money I don't have that in any case a tax code issue went in front of a judge, where the people trying to get the loophole running or maintain it had spent months screeching to the public what they were intending to do, they'd get similarly kicked in the metaphorical nads for their blithering incompetence.
Though yeah, judges are inconsistent. Welcome to the USA, where they're chosen by like a half dozen different methods and quality control is a concept heard of in stories of distant shores. Feel free to push for something less wobbly than that, but in the mean time maybe don't kvetch about what times shit actually works like it's supposed to.