These two things could not exist simultaneously without an explicit guarantee of legal protection from the government for online publishers of user content. Without that guarantee of protection it's doubtful that any platform could have grown as large as YouTube, Facebook, Twitter, or Google without taking a completely hands-off approach to user content (i.e. as a "common carrier"). The threat of litigation would have forced them to pre-emptively moderate all content just like print media and television.
In the 1990s Congress decided that it's okay for the internet to operate on different legal rules from the rest of society. They decided that internet companies can make editorial choices about their content freely without being legally held responsible for those choices, and the Supreme Court upheld that decision. Online speech is now the domain of Google, Twitter, Facebook, etc. and they have free reign over their virtual kingdoms without regard for any other legal system.