First of all, I'm not an expert, nor do I even study this stuff- this is just the opinion that I've formed based on my own life experience and studies, personally. This is what I think.
Humans are complex things that work in ways we still haven't been able to fully observe, scientifically, but the fact of the matter is, not only is every mental disorder "in your head" but also literally everything that makes you who you are, except for raw DNA is also "in your head." The notion of something not being real because it's "in your head" would also invalidate the entirety of what you perceive yourself to be as an individual.
If the question is about whether or not these things exist, empirically- the answer is an irrefutable yes, based on the observations that have been made and documented by biologists, scientists, and doctors over generations of medicine and studies. The issue isn't a matter of whether or not a particular disorder is real or not, but being able to diagnose such things. Because there's little to go off that can be proven by short-term physical observation, generally, proper diagnosis of these things requires thorough psychological examination, which, being something more complex, takes longer and is more expensive.
A lot of people are falsely under the impression that how people feel isn't relevant to whether or not something is real, usually born out of some inherent distrust of your own emotions. The truth is, yes, these things do matter because all human beings have emotions. They play a huge role in the day to day lives of people. This means that the imbalances that are caused by what we call "mental illness" are important, as well.
The same way having a cold can make you miserable, a mental illness can also, indeed, make you miserable. With that, I've established that, indeed, mental illness is something that is worth studying and learning about, so that professionals can help get people suffering from such illnesses the help they need to become healthy, both physically, and mentally.
While it is difficult to directly study the scientific processes behind human emotions and thought, emotions are something we can observe and study, just like everything else. In mental illness, the behaviors, observable emotions, and expressed thoughts- are the symptoms. The right combination of symptoms can then lead to a diagnosis, just like with physical illnesses.
The idea is that we study people that have indicated the potential for mental illnesses to determine what mental illness they have or at least, very likely have based on observation, and prescribe medication and/or therapy to help these people deal with said mental illnesses, so that they may continue living healthy lives.
I think that's a pretty noble pursuit, at least on the surface.
Things can get muddied by money and business, but I'm not here to discuss that.