They didn't operate within the law
RIPA permits targeted surveillance with warrant (unfortunately political, signed by William Hague, rather than a judge).
Grabbing all the data, storing it in a big database, then filtering for a target is not equivalent to that.
It's not equivalent, because William Hague has no way of determining the legality of the surveillance, that data included client-lawyer data, medical data, financial data, Parliament communications, the lot. The search is what reduces it to a legal result or not.
The search occurs later, after the warrant is issued.
So the two processes are not equivalent, and Hague is wrong to pretend untargeted mass surveillance with data retention and filtering is equivalent to a targeted intercept as provided by RIPA.
As to PRISM, well USA has a filter for 51% American, GCHQ has no such filter. So are Brits less of people to William Hague than Americans? I mean GCHQ are 'fine upstanding people' and Brits are not, because we don't even deserve a warrant with evidence? Not even a crappy filter?