Viacom, which owns the MTV and VH1 music channels as well as the Dreamworks and Paramount movie studios, had been seeking $1bn in damages saying it condoned piracy by hosting video clips in violation of copyright laws.
"Copyright protection is essential to the survival of creative industries," Michael Fricklas, Viacom's general counsel, said after the decision.
"It is and should be illegal for companies to build their businesses with creative material they have stolen from others."
Viacom said it plans to appeal to the US second circuit court of appeals, calling Stanton's ruling "fundamentally flawed".
But the decision was welcomed by internet service providers and free-speech groups.
"Without this decision, user-generated content would dry up and the internet would cease to be a participatory medium," David Sohn, a lawyer for the Centre for Democracy & Technology, said.
In dismissing the lawsuit, the judge noted that Viacom had spent several months accumulating about 100,000 videos violating its copyright and then sent a mass "take-down notice" on February 2, 2007.
By the next business day Youtube had removed virtually all of them, Stanton said.
Stanton said there was no dispute that "when Youtube was given the notices, it removed the material".
Earlier this year, Youtube estimated that users upload as much as 24 hours of video to its website every minute.
Internet giant Google bought Youtube in a $1.65bn stock deal in 2006.
Facebook, Ebay and Yahoo were among the internet companies that had backed Google in its battle with Viacom.