What a stupidly useless law, how is it still a thing after all this time. Laws are meant to protect rights and prevent harm
It's why people who cry about globalization are stupid. It's the reason why they drafted the law in the first place. The idea that it did "prevent harm" as a way to limit influence from outside culture during the Meiji Restoration. They viewed progressive ideas and concepts (ie pornography) to be subversive and damaging to the Emperor they had just restored to power. The growth of liberalism in Japan at this time resulted in them passing two laws: The Press Ordinance of 1875 (commonly referred to as the "newspaper abolition law") and the Publication Law of 1893, the basis of Japanese porn censorship to this day.
So tldr - Conservatives in Japan wanted to "prevent harm" from progressive ideology so porn is censored. Just like how conservatives are doing the same in the US