It's more complicated than that. The judgement accepts that the so-called "royal prerogative" (which really means government power) includes making and unmaking treaties. But it argues that since the EU treaties (uniquely) can override UK legislation, they must be immune to the royal prerogative (else the royal prerogative can override UK legislation, which they think is a contradiction).
Personally I think that argument is fallacious (e.g. the government has repeatedly voted in the Council of Ministers to accept new EU members, which has overridden UK legislation too). But the judges are trying to choose which constitutional principles to uphold in the face of the European Communities Act 1972 which radically altered the UK constitution without specifying how to resolve such contradictions. So I think it's hard to predict whether the Supreme Court will overturn the judgement on appeal — but in any case, we shouldn't attack the judges, because the legislative situation is contradictory enough that there's no very clean way to rule on this.