Because 'online' is the entire planet, including sellers in foreign countries. Would you like to have "digital borders" between countries, where data has to show some sort of passport to cross the border?
This ruling kind of assumes the opposite in some ways, that the strictest law anywhere applies everywhere. It's not digital borders, it's no borders but where the most draconian authoritarian law supercedes everything.
How does it do that? It doesn't seem to mandate age verification when a user from Poland access a server in France. Only when one of the parties (either user or hoster) is within the jurisdiction.
The Federal harmful-to-minors laws don’t mandate you check IDs. Only some state laws do. You’re better off asking, “why would buying a magazine here in Michigan have anything to do with Rhode Island statutes?”