The Metropolitan Police cannot dismiss officers by removing their vetting clearance, the High Court has ruled.