If you read the first judgement carefully you will find that the judge didn't see anything wrong with the book. On page 34 she says there's nothing new in the book. What it says was said by the investigation, it led to the McCanns being made arguidos and it has been said by others.
In order to penalise Amaral her judgement brings in his obligations as a retired policeman. Using some rather complicated mental gymnastics she decides that he has breached judicial secrecy and failed to allow the McCanns the presumption of innocence. Both of these requirements are imposed on a retired policeman, she argues, and they restrict his freedom of speech.
All the Appeal judges had to do then was show that being a retired policeman did not impose those obligations on Amaral, he enjoyed full unrestricted freedom of speech, and her judgement was shown to be wrong.
QuoteFreedom of speech and expression are not absolute, and common limitations to freedom of speech relate to libel, slander, obscenity, pornography, sedition, incitement, fighting words, classified information, copyright violation, trade secrets, non-disclosure agreements, the right to privacy, the right to be forgotten, public security, and perjury. Justifications for such include the harm principle, proposed by John Stuart Mill in On Liberty, which suggests that: "the only purpose for which power can be rightfully exercised over any member of a civilized community, against his will, is to prevent harm to others."[7]
https://en.wikipedia.org/wiki/Freedom_of_speech