The ruling by U.S. District Judge Colleen Kollar-Kotelly found the agency does not have "substantial independent authority" so it is not subject to the Freedom of Information Act.
The decision means the White House does not have to disclose documents relating to its troubled e-mail system. That system developed problems that may have caused millions of White House e-mails to be unaccounted for.
The watchdog organization Citizens for Responsibility and Ethics in Washington had sued under FOIA. The group expressed disappointment in the ruling and said it is appealing the decision.
"The Bush administration is using the legal system to prevent the American people from discovering the truth about the millions of missing White House e-mails," said Melanie Sloan, the organization's executive director.
In January, the White House said it cannot rule out that it may have lost certain e-mails. The possibly lost e-mails are from a period in which the United States decided to go to war with Iraq, White House officials leaked the identity of CIA officer Valerie Plame and the Justice Department started a criminal investigation into who leaked the information.