In both instances, medicalization of these things is such a huge cover-up for bigotry.
People who accuse trans people of having a "mental condition that needs to be treated either without transition or with excessive gatekeeping" aren't looking out for their best interest. They just want to attempt to logically justify their transphobia, which, in actuality, stems from a "trans people are icky" mindset. They know well enough that calling something "icky", however, doesn't serve as an actual argument, though, so they have to pull some kind of rationale out of their ass, even if it's rooted in falsehood.
Fatphobic people are the same. Once again, they're not concerned with them being "unhealthy". They just think fat people look unpleasant and want to try to rationally justify it by seeming empathetic about their health when they're obviously not.