U.S. District Judge Gladys Kessler said under federal law she did not have jurisdiction to order an end to the force-feeding.
More than 100 inmates remained on a hunger strike at the U.S. prison at Guantanamo Bay, Cuba, on the eve of Ramadan, the military said.
The protest began in February, and military prison officials said this weekend that 106 were refusing to eat, 45 of whom were under orders to be fed against their will.
The protest began over what the United States said were false rumors that Guantanamo guards were desecrating the Muslim Koran. There was also a growing despair that Guantanamo was still operating after President Obama had pledged to shut down the prison.
The detainee, Jihad Dhiab of Syria, had asked for a preliminary injunction against the force-feeding, asking for a quick decision because of the onset of Ramadan.
Kessler said Dhiab had been at the prison for 11 years.
The judge pointed out that a section of the federal code enacted by Congress bans judges from ruling on the conditions of Guantanamo detainees.
Kessler said although she does not have the authority to change conditions at the U.S. detention center, Obama does, citing his national security speech in May.
"Is that who we are?" Obama said. "Is that something that our founders foresaw? Is that the America we want to leave to our children? Look at the current situation, where we are force-feeding detainees who are holding a hunger strike. ... Is that the America we want to leave to our children?"
2014: NFL Cheerleaders [PHOTOS]
Cyclist struck and dragged underneath car