For one thing, facilitating spam is some distance further down on the benefits to harms scale than facilitating Facebook or Google. Google, especially, has created a enormous amount of value, and continues to do so^; spam, not so much.
^Which isn't to say that it's perfect, of course. Or even necessarily a net good, although my personal belief in the case of Google is that it still is.