The decision was made at an emergency hearing on Wednesday in a Van Nuys courtroom.
The 70-year-old maintains her innocence. She was arrested in New York City in August just as she was about to serve as a line judge in a U.S. Open match. She was extradited back to Los Angeles to face charges that she killed her husband, 80-year-old Alan Goodman, last April in their Woodland Hills condominium.
Goodman reported her husband's death, telling police she had come home from a tennis match and discovered her husband had fallen down the stairs. But investigators said blood found throughout the home wasn't consistent with a fall, and neither were his stab wounds.
DNA was taken at the time of Goodman's arrest, but that sample was sent to a state database. Prosecutors said they needed a separate saliva sample.
The defense argued that prosecutors had not shown probable cause that Goodman was involved in the homicide, and that taking the saliva sample was an unnecessary intrusion.
"Mrs. Goodman is innocent. I want to make that as clear as I can," said defense attorney Robert Sheahen.
But prosecutors offered no hint as to how DNA might link Goodman to the murder -- a crime that happened in her own house where her DNA would be found throughout anyway, the defense argued.
But the judge ruled in favor of the prosecution, saying the sample must be taken in a private setting. Defense attorneys say they are considering an appeal. They have five days to file an appeal.
Goodman remains free on bail, wearing an electronic monitoring device. Her next court appearance is scheduled for Oct. 3. She has pleaded not guilty.