After the president’s latest attack on American intelligence agencies, questions resurfaced on whether they invade privacy and could undermine democracy.