Maine and the University of Pennsylvania could lose millions of dollars for allowing transgender students to compete on women’s teams.