Common Pleas Judge Steven O'Neill issued the ruling after a hard-fought two-day hearing, saying witness credibility was a factor. He did not elaborate.
In another setback for the defense, the judge also denied a request to disqualify newly elected District Attorney Kevin Steele from the case. Cosby's lawyers had accused Steele of making a "political football" out of Cosby during the campaign.
Cosby, 78, was arrested in December and charged with drugging and violating former Temple University athletic department employee Andrea Constand at his suburban Philadelphia home in 2004. The TV star could get up to 10 years in prison if convicted.
Cosby held his head in his hands after the ruling, then left the courtroom, using a cane to descend the ornate marble staircase. He waved and smiled at supporters but had no comment. His lawyers put their arms on him to comfort him.
The next step is a preliminary hearing March 8 to determine whether prosecutors have enough evidence to put him on trial.