The case had been closely watched as an important test of whether bans on transition care for minors, enacted by more than a dozen states, could withstand challenges.