How is it that Law may work by “legal precedent” but then it also “goes with the current culture and ethics”? won't they conflict with each other?
They will (and do) conflict with each other, in part because much of the judiciary is incompetent. Many judges are driven by ineptitude and/or illicit interests, and they don't care about the ensuing nonsense of their blatant distortion of the laws. The ruling to which you allude is an example of that.
According to this article, in 2002 "[an] attempt at a constitutional reinterpretation of the adultery law failed, as 18 justices unanimously ruled it constitutional". Now they ruled it is unconstitutional. This change of mind inevitably prompts several questions: What prompted the drastic change with respect to the ruling from year 2002? Did the bulk of judges learn to read during the latest 18 years? Or did they forget that civilians are still able to read & comprehend legislation? What public confidence does that extent of judicial erraticism confer to the rulings judges have been issuing in the meantime? Or is it that judges have gotten worse now? Which judicial generation/offspring can we say is the good one?
Even the group which applauds the new ruling admits that it embodies a new definition of marriage and family. Coming up with novel definitions is tantamount to jus dare insofar as therewith the painstakingly enacted laws are vitiated. Furthermore, the justice ministry's acknowledgement that roughly 80 percent of Taiwanese are opposed to decriminalizing adultery contradicts the [judge's?] excuse that "current culture and ethics have changed" in this regard. This development has all the appearance that the judiciary has catered to minoritary groups at the expense of both legislation and society's broad consensus.
This issue is notorious also from the standpoint that "women are disproportionately [...] convicted under the law". Such gender bias does not stem from flawed legislation. It stems from judicial ineptitude. Indeed, Article 239 of Taiwan's Criminal Code is in terms of "[married] person" and "the other party to the adultery", whence only courts are responsible for the alleged disproportion that women have endured. Being the violators of the principle of equal protection in the Constitution, these judges' new ruling is hypocritical to the extent that they premise it on that constitutional principle. Regardless, attacking the adultery law is a misdirected effort against the gender bias that happens in court.