And no, four justices were not "stupid enough" to agree that 1152 superseded 1182. Section 1152 is literally not referenced a single time in either dissent.
Breyer dissented on the basis that "on balance, find the evidence of
antireligious bias, including statements on a website
taken down only after the President issued the two executive
orders preceding the Proclamation, along with the
other statements also set forth in JUSTICE SOTOMAYOR’s
opinion, a sufficient basis to set the Proclamation aside."
Sotomayor dissented on the basis that "[the majority's opinion] does little to cleanse Presidential
Proclamation No. 9645 of the appearance of discrimination
that the President’s words have created.
Based on the evidence in the record, a reasonable observer
would conclude that the Proclamation was motivated by
anti-Muslim animus. That alone suffices to show that
plaintiffs are likely to succeed on the merits of their Establishment
Clause claim. The majority holds otherwise by
ignoring the facts, misconstruing our legal precedent, and
turning a blind eye to the pain and suffering the Proclamation
inflicts upon countless families and individuals,
many of whom are United States citizens."