Foster carers' views on sexuality are relevant, High Court rules