Necessity plays a large role in determining whether something is legal.
Many court opinions about a law or government action hinge on whether there is a compelling state interest in the result. When balancing what a government does against rights defined by the bill of rights, you need to show that there is a good reason for the government to do what it's doing beyond simply denying the people their guaranteed rights.
For example, you may have laws about having a parade without a permit. Now, if you took an extreme view on the first amendment, you might say this abridged the rights of the people to peaceably assemble and speak their mind. However, there is a compelling state interest in controlling access to the roads that are shared by everyone; if anyone could parade at any time, it would screw up traffic. So governments are allowed to require a parade permit, as long as the requirements for obtaining one are content-neutral and don't single out any particular groups.
Likewise, whether the spying is legal does depend on whether it's necessary. The fourth amendment clearly says "The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures..." Whether the search is reasonable plays a large role in whether it's legal. Thus, necessity is important, as well as being legal in the sense of having followed the letter of the law (gone through the appropriate warrant process, as outlined by the various laws and regulations that control it).
Many court opinions about a law or government action hinge on whether there is a compelling state interest in the result. When balancing what a government does against rights defined by the bill of rights, you need to show that there is a good reason for the government to do what it's doing beyond simply denying the people their guaranteed rights.
For example, you may have laws about having a parade without a permit. Now, if you took an extreme view on the first amendment, you might say this abridged the rights of the people to peaceably assemble and speak their mind. However, there is a compelling state interest in controlling access to the roads that are shared by everyone; if anyone could parade at any time, it would screw up traffic. So governments are allowed to require a parade permit, as long as the requirements for obtaining one are content-neutral and don't single out any particular groups.
Likewise, whether the spying is legal does depend on whether it's necessary. The fourth amendment clearly says "The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures..." Whether the search is reasonable plays a large role in whether it's legal. Thus, necessity is important, as well as being legal in the sense of having followed the letter of the law (gone through the appropriate warrant process, as outlined by the various laws and regulations that control it).