It is called following local laws if you want to operate in the market under the jurisdiction of these local laws. You are free to not comply and then they are free to prevent you from operating. It is the same like individuals visiting/moving to this place. Being private/public company does not grant you immunity.
If that happens, it won't be a law, but a court-ordered punishment intended to force compliance. It seems that courts are allowed to do a lot of things to force people to comply with their orders. Up to and including imprisonment. Punishments given for this purpose apparently go away as soon as compliance happens. And this is a general principle, not just in Germany.
Germany probably already has a system for the government to order ISPs to block certain domains. It would be surprising if any overbearing surveillance state didn't.
Why would a nation allow a private US company to run roughshod over their laws to the detriment of their society? Just because some other nations are so abused by corporations that do allow it? What’s the logic behind this?