I'm going to assume you accidentally left out the word "healthcare" after "trans" and "a medical necessity." I'm also going to assume that English isn't your first language because the syntax of your sentence/question isn't lining up and is confusing as hell.
While the U.S. was indeed arguing on behalf of transgender children and their guardians, the case isn't about whether trans healthcare is a freedom of choice. Which by the way, I honestly don't know what the hell you mean by that. "Is trans a complete freedom of choice?" What the fuck does that mean?
The bottom line is it shouldn't have mattered whether trans kids or trans healthcare was involved in the case or not. This is about the Equal Protection Clause of the 14th Amendment of the United States. Should the government be able to pass legislation that denies citizens access to healthcare based on ANY criteria?
In my opinion the answer is a resounding no. It doesn't matter if one is receiving treatment for gender dysphoria, diabetes or cancer. The court failed the American people and in my opinion this is going to open the door and set precedent for dangerous policies against all citizens of the country.