Officials had ‘erred in issuing a blanket direction by treating certain citizens as troublemakers’, the court said.