Flawed Knowledge 'Spying' Laws Should Be Changed, Say Judges