All of NSA's spying and surveillance is actually legal in the US
The secret Foreign Intelligence Surveillance Court should be overseeing the US government in its attempts to expand its surveillance, but it hasn't actually done a great job at that.In fact, the court approved most of the tens of thousands of requests various US government agencies had made for surveillance and search warrants.
However, it's done more than just rubber-stamp whatever it was the government asked for. Through its decisions (which, of course, are secret), it has created a body of common law that gives the NSA and other government agencies powers that exceed anything covered by the laws that should govern their operation.
The New York Times has revealed the existence of several rulings that give the NSA authority to spy on Americans not just in matters having to do with terrorism, but also in everything related to nuclear proliferation, espionage, and even cyber attacks.
The court has provided interpretations of the US constitution and laws that are favorable to NSA spying and has done this with no public scrutiny. In a sense, the FISA court has subverted the Supreme Court in most matters of privacy and surveillance.
Unlike the Supreme Court, the FISA court's rulings and interpretations are secret and it asks for no input from groups which may oppose the views put forward by the government.
In one example of this expanding body of common law, the court provided a much broader interpretation of the "special needs" principle which was established in 1989 by the Supreme Court to allow mandatory drug testing for railway workers. The argument was that this violation of privacy was outweighed by the dangers posed by not running these tests.
But the FISA court took the same argument and applied it to terrorism and to mass scale privacy intrusion. In its view, this means that NSA spying on Americans does not contravene with the Fourth Amendment, giving the agency almost free reign in gobbling up as much data as possible.