From Merriam-Webster: any of a broad range of medical conditions (such as major depression, schizophrenia, obsessive compulsive disorder, or panic disorder) that are marked primarily by sufficient disorganization of personality, mind, or emotions to impair normal psychological functioning and cause marked distress or disability and that are typically associated with a disruption in normal thinking, feeling, mood, behavior, interpersonal interactions, or daily functioning.
Gender dysphoria is a mental illness because it is marked by the distress caused by one's gender differing from their birth sex. This does not make transgenderism itself a mental illness, nor does it mean that people experiencing dysphoria are intrinsically inferior to those who do not. Mental illnesses, like all other illnesses, deserve to be treated for the good of the person afflicted with them. We're all human, and we all deserve respect.