"The collection of breathtaking amounts of information unprotected by the Fourth Amendment does not transform that sweep into a 'Fourth Amendment' violation," he wrote.
Also, while Leon expressed deep skepticism about how much benefit the government gets from its database, Pauley accepted the government's argument that it's vital.
"The collection is broad," he wrote, "but the scope of counterterrorism investigations is unprecedented."
The decision comes as President Obama weighs whether to impose new restrictions on the NSA's activities or not. Last week, a presidential task force urged Obama to adopt new limits on the agency. Obama said he is taking the recommendations seriously and would announce a decision on them in January.
The latest ruling is certain to bolster the arguments of the NSA's allies.
"We are pleased the court found the NSA's bulk telephone metadata collection program to be lawful," Justice Department spokesman Peter Carr said in a statement.
The American Civil Liberties Union, which brought the case, issued a statement expressing disappointment and promising to appeal.
The decision "misinterprets the relevant statutes, understates the privacy implications of the government's surveillance and misapplies a narrow and outdated precedent to read away core constitutional protections," said Jameel Jaffer, the ACLU's deputy legal director. "As another federal judge and the president's own review group concluded last week, the National Security Agency's bulk collection of telephone data constitutes a serious invasion of Americans' privacy."