A social network operator isn’t liable for the death of a man who overdosed on heroin bought from a drug dealer he met on the site, a federal appeals court ruled.

Ultimate Software was immune under the Communications Decency Act because it wasn’t involved in creating content on the Experience Project, a social networking website where users anonymously shared experiences and answered questions, the U.S. Court of Appeals for the Ninth Circuit said Aug. 20.

The decision underscores the broad protections social media sites have against attempts to hold them accountable for harms allegedly caused by content on their platforms....