The High Court has ruled against the use of ankle monitoring devices and curfews to track immigration detainees.