How can this be a unanimous decision if Scalia wrote a scathing dissent?
None of the reporting on this makes any sense whatsoever.
The Supreme Court can separate its decisions into separate questions and then answer those questions separately. Since the court can do this, it is technically possible for the court to have some questions answered unanimously while being divided on other issues.
I don't know if that happened here, though it is likely that this did happen on the part of the law that was sent back to the 9th circuit court for review.
You will probably be happy to note that Scalia did quote Vattel's Law of Nations as a legal authority at the very beginning of his dissent:
As a sovereign, Arizona has the inherent power to exclude persons from its territory, subject only to those limitations expressed in the Constitution or constitution ally imposed by Congress. That power to exclude has long been recognized as inherent in sovereignty. Emer de Vattels seminal 1758 treatise on the Law of Nations stated:
The sovereign may forbid the entrance of his territory either to foreigners in general, or in particular cases, or to certain persons, or for certain particular purposes, according as he may think it advantageous to the state. There is nothing in all this, that does not flow from the rights of domain and sovereignty: every one is obliged to pay respect to the prohibition; and whoever dares violate it, incurs the penalty decreed to render it effectual. The Law of Nations, bk. II, ch. VII, §94, p. 309 (B. Kapossy & R. Whatmore eds. 2008).