Indeed
GCHQ may well do what they like, but they have been shown to have been breaking the (very small) amount of legal restrictions that where placed on them, and deliberately hiding the evidence from the court that is supposed to have oversight of them.
So passing the law to retroactively make ~15 years of illegal surveillance legal, and the retention of data also legal was pretty much the goal. It's why the same legislation has been making the rounds for a decade or so now.