Legislation can limit what Federal agents are allowed to do totally irrespectively of whether those things would separately violate the constitution.
And in any case: the law is a blunt instrument. It's (usually) better as a slowly changing representation of conventions and social consensus instead of something that we make sweeping changes in (whether legislatively or judicially).