He should have.
The first judges judgement was flawed.
I don't think anyone should start gloating just yet.
First of all, going to law is always an uncertain business, so you must always be prepared for a case to go against you. By and large, Judges do an excellent and thoughtful job in reaching their decisions.
Portuguese law, in common with other Roman Law systems is codified, and in this judges do have discretion as to which parts of the code they see fit to apply in a particular set of circumstances. So it perfectly possible for two courts, presented with similar cases, to come to two quite different judgements - and for both to be correct according to the code. As seems to be the case here.
Ironically, this makes it more unpredicatable than English common law which relies on precedent.
Until the Supreme Court has had its say (if the McCanns do decide to appeal) it may be unwise for anyone to celebrate too publicly.