The suit, filed in 2018 by nonprofit Freedom Watch and right-wing YouTube personality Laura Loomer, accused the four tech companies of stifling First Amendment rights.
In a ruling on wednesday, the US appeals court in Washington, DC dismissed the lawsuit and said that the First Amendment rights regulates the government, not the private sector, TechCrunch reported.
District Judge Trevor McFadden noted that the complainants could not prove that the companies were "state actors".
"The Plaintiffs do not show how the Platforms' alleged conduct may fairly be treated as actions taken by the government itself," the judge wrote.
"Facebook and Twitter, for example, are private businesses that do not become ‘state actors' based solely on the provision of their social media networks to the public."
In general, the First Amendment "prohibits only governmental abridgment of speech", the ruling pointed out.
With respect to Twitter and Facebook, Freedom Watch specifically alleged that those platforms prevented Loomer from using their services.
Loomer was banned by several platforms for alleged anti-Muslim statements.
With respect to Google and Apple, the suit alleged that those companies were engaged in a conspiracy against Freedom Watch.
The ruling dismissing the suit came on the same day Trump warned social media giants that his government could "strongly regulate" or "close them down" after Twitter fact-checked one of his tweets for the first time.