Walled gardens like AOL and CompuServe failed because they had to compete with everyone else. In the early '90s, there was a lot of content that was exclusive to AOL or CompuServe. There were a load of small BBS that had their own unique content. And then there was the Internet. Anyone could put something on the Internet and when web browsers started to be easy to install anyone could put up a web page. Individuals would put things up on their ISPs' web space or somewhere like Geocities, big companies would buy their own servers. Small individual ISPs started to spring up, because the cost of entry was low: a rack of modems, a leased line, and a load of phone lines and you could be an ISP. Local ISPs competed by differentiating themselves in various ways (free email, free web space, static IPs, whatever).
Meanwhile, AOL and CompuServe (OSPs - Online Service Providers) were trying to sell access but also be responsible for all of the content. The parallel with Facebook isn't quite there, because they're only selling the content. The problem is that, while there is some content on Facebook, anyone who can access Facebook can also access the whole of the web. They need to somehow justify putting content on Facebook (where only Facebook users can see it) rather than just putting it on a web site. Their argument for this is that they can collect lots of data about potential customers if you do, but it's not clear that this is a good long-term alternative.