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?
Plenty of people have been arrested for importing things legal in Japan that are illegal in the West.
Plenty of countries have laws on the books that make it a felony to even look at what's on the average Japanese store bookshelf while you're in Japan.
Why should the laws be different just because you're moving electrons instead of atoms?