The Bush administration argued that such a program was legal and necessary to defend the nation from terrorism.
But the American Civil Liberties Union, along with groups and attorneys based in Michigan, filed a lawsuit in Detroit in January 2006 saying that the government's surveillance program was unconstitutional and interfered with their jobs.
U.S. District Judge Anna Diggs Taylor in Detroit ruled in favor of the plaintiffs last August. The U.S. Justice Department then appealed the case to the Sixth Circuit Appeals Court.
Kary Moss, head of the Michigan branch of the American Civil Liberties Union, said "it's a really unfortunate decision."
She said that one of the reasons the plaintiffs had difficulty proving they were being adversely affected was that the government has kept information about the wiretapping program a secret. Moss said they are considering appealing the decision to the U.S. Supreme Court.
Dawud Walid, head of the Michigan branch of the Council on American Islamic Relations, one of the co-plaintiffs, said: "It's a shame that the court overturned the decision... what the executive branch was doing was unconstitutional."