The order was a blow to Indiana legislators who passed a law banning transgender students from participating in all-female school sports. The state’s Republican governor vetoed it, warning that this would be the result.