So as you discussed in comments on your own line, this actually isn't a precedent concern... It's a constitutional concern.
Essentially, for the nations that have constitutions (these days, most of them... there are a handful of nations with "uncodified" constitutions, and even then, they still have documents that have the same effect).
Because most Constitutions are copying the United States Constitutions and making suitable changes, they generally do 5 Things: Establish the Constitution is "The Supreme Law of the Land", Establish the various branches of government, and what they can do, Establish what those branches cannot do, establish the rights of sub-national political units and citizens, and how to amend the constitution should the need arise.
That first part, where the Constitution is the "The Supreme Law of the Land" is quite critical feature here. In the U.S., which has a complicated federal structure, Federal Law is superior to State Law which itself is Superior to Local Law, which is Superior to one's own personal code of conduct.
If two laws are passed at the same level of superiority and one law conflicts with the other one, the law that is superior is the law that is used on the matter. Typically at the same level of superiority (i.e, A U.S. state passes a law that conflicts with the another law it passed) the law passed most recently will be "superior" and thus conflict.
The only exception is if the law passed prior to the conflict claims it is "Superior Law" for that level. Since Constitutions, claim "Superiority to all future laws" no law may be passed or enforced if it is in conflict with the Constitution. When a law is passed that conflicts with the constitution, all parts of the law that are in conflict are declared unconstitutional (It could be that a portion of a law is still constitutional and can be enforced. I.E. suppose a state in the United States passes a law that says "It is illegal to call 911 as a joke OR while wearing a clown costume." A judge may rule that this law is unconstituional but only with respect to the part regarding clown costumes while making it illegal to prank call 911 is still constitutional... thus the law stands, but only for enforcing the first part and not the second).
So in effect, the judge is not bowing to a changing standard of societal morals but agreeing that the Tiawanese Constitution does not support the criminalization of adultry, thus the law regarding adultry is null and void to the extent that it presents a criminal burden only... that adultry can still be used for grounds for a diviorce case (which is a civil law matter) is still perfectly constitutional. To put it another way, criminally prosecuting someone for adultry is, by the Constitution, not something the government can do nor something it could ever due, therefor the government may not enforce this part of the law and where they already have, they must make amends to the citizens so wrongly prosecuted. Or to quote Whoopie Goldberg "It was wrong then, and It is wrong now."
It should be pointed out that what is "legal" is not always what is "moral"... and this is not always a terrible thing... its a good thing that the law allows for those who dare to question societies' morales the freedom to do so. Consider the U.S. Civil Rights Movement... At the time it happened, it was not moral for African Americans to speak out against the Jim Crow Southern United States... but it was still "legal" for them to do so.
It is far worse that there are situations where what is "moral" is not what is "legal". Not every minority in the world has the ability to speak out against the mistreatment at the hands of the majority.