They didn’t. They ruled corporations don’t have much free speech when it comes to product advertising and declarations of potential harm their products may cause their users.
Can you post a link to RCT-based evidence backing this claim? I don't see anything on CDC website or any professional medical organization about Facebook being as harmful as cigarettes.