The same way journalist and activist are protected.
Should you blame the mailman if he deliver some harassing anonymous letter ? The physical mail offer the same sort of protection if it's done properly.
If someone harassed me with anonymous letters, I would open a police report. The point is that no equivalent recourse exists online.
Edit: The point being that the mailman is a red herring. If the internet is really an extension of public space as (presumably) claimed, let's treat it like one.
I m no expert in that field. Probably better than you think since the police has access to a lot of tools to find you and been an harasser doesn't mean you have the technical skill to be anonymous enougth.
We are now in an endless debate. Internet isn't the problem. Bad behaviours, uneducation, missinformation, fake news, etc are the problem.
Blaming internet won't solve those. And they will be ready for the next tool.
How would it change anything if the harasser did it in the real world? Online there are logs of it, in the real world it'll be you word against theirs.
I am not suggesting that harassment ceases to exist in the real world, I'm saying that it's simply not so cut-and-dry as the parent's comment suggests. An individual's behavior can drastically alter between the physical and virtual world, where social norms and filters can easily be tossed aside.