Discharging Covid patients into care homes was unlawful, High Court rules