This involves interaction between legal liability, the nature of online services, and copyright law. If a person does something that causes damage, they may be liable and required to pay for damage. Given the right protected by copyright law, damage results in making unauthorized copies of a work, and the copier can be made to pay. A person who contributes to bringing about damage can also be held responsible, depending on their exact relationship to the damage (copyright infringement in relevant cases), so in Gershwin Publishing v. Columbia Artists, Columbia organized a musical event where various artists did the infringing performances, knowing very well that there was no permission as required by law. The court held that "one who, with knowledge of the infringing activity, induces, causes or materially contributes to the infringing conduct of another, may be held liable as a 'contributory' infringer".
There are various nuances regarding how a potential enabler might or might not be held liable. In MGM v. Grokster, Grokster knew that their software was primarily used to disseminate protected material, and encouraged infringement. Similarly (and earlier), Napster was found to be contributorily liable in A&M v. Napster. On the other hand, in Sony v. Universal, it was found that Sony was not liable for selling VCRs which allowed people to infringe copyright, primarily because Sony did not sell the VCR with the intent of aiding copyright infringement.
Such "codification" as exists regarding contributory infringement and liability is due to case law. Congress could, if it wanted to (it does not), pass a law saying that no online service can be held liable for copyright infringement. This would require changes in copyright law, since online services do copy content (taking it from a contributor involves copying, delivering it to a customer does to), and they obviously distribute the material (usually by automated means, but that is still distribution). Any use of digital content in fact involves making many copies, almost all of them automatic (copying from an input port to a data buffer; copying from the buffer to disk storage; copying from disk storage to RAM; from RAM to computer registers; etc. where derivatives are "copied" to the speaker or computer screen). This fact makes digital services particularly vulnerable, since virtually everything that they do involves "making a copy".
Congress passed the Online Copyright Infringement Liability Limitation Act as part of the Digital Millennium Copyright Act, which provided a way for online providers to be protected from liability, as long as they have "clean hands" and follow certain rules. The essence of this law is that if you provide a means for copyright owners to inform you of violations, and you respond expeditiously to proper notices by taking down infringing material, you may be protected.
Simply posting a notice that says "we do not condone breaking the law" does not eliminate liability. If one takes reasonable steps to prevent infringement, you would not be liable.
Apart from copyright infringement, websites can also be engaged in distributing child pornography, which also is against the law (even more so). And once you go outside the US, and are in a country with limited free speech protection, making forbidden statements can get you shut down. Getting "shut down" can come in multiple forms: one, where the company goes out of business because the damages that they have to pay are substantial, and also because the government can directly order a web site shut down (as in the Napster case).
If online services are more susceptible to being shut down compared to other businesses, it is probably due to the mistaken feeling of anonymity and failure to understand copyright law.