The exclusion of coverage for gender-affirming health care is illegal discrimination, a federal judge ruled Friday.