It makes sense once you realize who the real enemy is. It's not the terrorists/Islamists/Chinese/Russians, it's the citizens of the US/UK/NZ/Australia and other countries that are the target of the spying. The general population is the enemy.
In the delusional hyper-paranoid NSA world you gain power and control when you know things that other people don't know. It's all about insiders and outsiders. If the outsiders find out what's going on, they might become less pliable and start wondering about what's going on and ask questions. They might even start objecting to the current setup.
Some of it is about money. The US is spending something over $50 Billion per year. That a long way from chump change, and a lot of companies are getting very very rich from that. I don't think that the direct government employees are the big winners at this, I think the outside contracting companies really rake it in. First you pay your dues working for the Feds, then you make a vastly higher amount doing the same thing in the private sector. That's what Snowden did.
The second thing is fear of failure. Everyone is terrified of taking the blame for the next successful big attack. They want all the data in the vain hope that it means that failure can be avoided forever. It's not possible, but given effectively unlimited resources they can engage in the insane project of trying to spy on every human on earth.
So not only is the goal impossible, it is a huge waste of resources. For the kind of money they are spending they could literally buy off many of the "bad guys" they are fighting. (This assumes that the money was spent wisely, as opposed to the complete cluster fuck of wasted money poured into Afghanistan and Iraq.)
For example, offer the Palestinians and the Israelis billions of dollars each for domestic non-military spending, with the condition that any violence on either side means a complete immediate shutoff. (And no more Israeli building on the west bank.) Assume they are corrupt and can be bought, and it just might work. Even if it doesn't work, at least the money will be poured down some new rat holes for a change.