"We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves..."
Presidents did it, and much more dangerous investigatory practises, under their Article II power to "repel sudden attacks" and to deal with foreign agents.
Until Nixon it was done without any judicial or legislative review.
It was allowed under the previous law this one amended.
The "reasonableness" of national security investigations have been held to a different standard than criminal ones for obvious constitutional and objective reasons- whatever one may think of their wisdom.