This is going to be one of those posts where I don't really have an answer. The reason I'm writing about it is that many people don't realize that it is a particularly difficult question. I think there's often a sense that because psychology is a science, we can have (relatively) precise definitions of what mental illness is. In fact, many of the judgments that go into defining mental illness are independent from any particular scientific discoveries.
I'll just note first that defining illness in general is substantially complex. It's not, for example, any kind of impairment that my esophagus and my windpipe are connected. However, if there were some people whose esophagi and windpipes were totally separate systems, such that they never were in danger of choking, my condition would look extremely perilous and maladaptive. There are also problems of vagueness, how bad does a certain condition have to be before we consider it a disease or an illness, etc. These problems might be conceptually a bit puzzling, but most often are not that troubling in any way. Mental illness, as a concept, is much more troubling.
The distinction between the two is this. Illness, in whichever sense, is a normative concept, insofar as it defines something as a problem based on how it deviates from certain standards of functioning. You can run into some controversies around this, for example from some individuals in the deaf community who do not see deafness as an impairment, and find the "standards" to which I appeal to be oppressive. There are some interesting points to be made about such a case, but for the most part I think there are some satisfactory answers to be given to these sorts of problems.
When we apply the concept of illness to people's mental states, it is a normative concept in a very deep sense of the word. It's normative in that it defines what a standard in, but the standard has moralized implications. We think there's something problematic about the kind of person someone is. And this is quite a different judgment, in my view, than the judgment that there's something wrong with, e.g., an arthritic person's joints.
I don't mean to imply that we are blaming people for the mental illnesses they have. But the judgment that they are mentally ill is a much deeper one than a judgment that their immune system is malfunctioning.
Think, for example, about how homosexuality was classified as a mental disorder (This American Life has fantastic episode documenting the history of this.) Some people think of this as bad science, but that's not right. The treatment of mental disorders is a science (and the science on treating homosexuality is, as far as I know, quite fallacious), but the classification of mental disorders has a lot more to do with (moral) normative judgments. The judgment that homosexuality is a mental illness is a judgment that homosexuals should be treated as mentally ill. If it were morally wrong to engage in gay sex, it would make sense to classify homosexuality as a disorder.
One brief point to make here is that the "born this way" arguments are a red herring. Consider kleptomania. It's conceivable someone could be born a kleptomaniac. Even if they were born this way, their theft would still be wrong, and it would make sense to classify it as mental illness. So the fact that gay people might be born with a predisposition to be gay does not count in favor of it being unobjectionable. The reason there's nothing wrong with homosexuality is that it's permissible to have homosexual relationships or homosexual sex. (This isn't circular, because it's a separate question whether having homosexual sex and relationships is permissible, which I'm assuming here that it is.)
So for homosexuality to be deemed not a mental illness was a cultural and moral step, not a scientific one. Society has slowly come to realize that there's nothing wrong with people being gay, so there's no reason to treat same-sex attraction as an illness, or some problem to be solved.
To take a somewhat different example, consider depression. Now, we do not exactly think it's morally wrong to be depressed, but we do think it is desirable not to be depressed. So deeming something to be a mental illness is not just a moralized judgment in terms of what obligations individuals have towards others to engage in (or not) certain kinds of acts, but we think there are better ways of being and not being. It's better to be generally happy than not, and it's better not to be constantly anxious.
Now these examples are not unlike cases of physical illness or impairment(it's better to be able to see than not.) But because our lives are complex, some interesting questions that arise. Is someone depressed when they're grieving the death of a loved one? This is a question that is currently being wrestled with in the DSM-V. I think this particular question, at least, comes down to a pragmatic judgment. Is it better to classify grieving people as depressed, or say that that's just a natural part of human life that we should accept? This, in part, depends on a moral question of whether or not we think it's fitting or appropriate that someone experience the bad feelings to come along with grief, or should they be avoided as much as possible?
All of which is not to say I have an answer. I will have more to say about this topic in the future. But for now I just hope to make the point that judgments about mental illness are based on pragmatic, moral, and normative claims, rather than the basis of scientific judgments.