U.S. District Judge Sparkle Sooknanan said the administration violated the law when it created a centralized database of Americans' personal records.