A Texas judge warned that allowing the case to stand would give agents ‘carte blanche’ to commit abuses