While granting Cuban's motion, U.S. District Judge Sidney A. Fitzwater gave the Securities and Exchange Commission 30 days to file an amended complaint.
The SEC alleged Cuban was involved in insider trading when he sold shares in an Internet search engine company, Mamma.com Inc., after receiving confidential information about a private offering in 2004.
The SEC said the billionaire NBA owner avoided a loss of $750,000 by selling his 600,000 shares, which represented a 6.3 percent stake in the company.
In his 35-page ruling, Fitzwater wrote that the SEC didn't accuse Cuban of promising not to trade based on the confidential information he received. Thus, the commission could not hold him liable for illegal insider trading, the judge wrote.
Fitzwater said the SEC could file a new complaint if it can allege that Cuban promised not to trade on the information.
The judge rejected some of Cuban's claims about his fiduciary relationship with the company, however.
An SEC spokesman didn't immediately return e-mail and phone messages seeking comment.
Ralph Ferrara, one of Cuban's attorneys, said he needed time to digest the ruling but was initially impressed with what he called Fitzwater's "appellate court level" analysis.
"It sounds like unlike many trial courts on motions to dismiss, he really tried to come to grips with the fundamental legal policy questions that we raised," Ferrara said.
Cuban didn't immediately respond to an e-mail seeking comment.