Before medicine & psychiatry people weren't treated. People with mental health issuers were either retarded/stupid, crazy, or possessed by evil spirit.
As either retarded, crazy, or possessed ... You were either locked up, kept confined (like working in a factory sweeping, or chained up on a farm, or simply not trusted to ever hold any kind of meaningful position in life, including marriage/children), or killed out of hand. If it was believed you were possessed that death would be exceptionally painful (burned to death was common).
What science & medicine have done is to first taxonomize (hey, wait, there is more than one kind of crazy, more than one kind of stupid, and let's just ignored possessed by satan all together, because come to find everyone we thought possessed actually has some really obvious cause&effect), and then, once we've separated things out into different categories? Tried to find the best way to treat people. Moreover, coming together to pool knowledge and redefine as we understand better what things are, and what works best to treat those things.
I fail to see how not burning people at the stake, locking them in prisons and asylums, or writing them off as too stupid to do anything with... But instead to be looking for causes and solutions is this awful, scary, terrible thing.
Diagnosis doesn't change a single atom of who a person is. Roses by any other name are still roses. What it does do, is gives us the opportunity to find the best way to deal with it. Roses need different care than tomatoes and tomatoes need different care than kittens. Science is seeking to understand. Not starting out with a perfect understanding. We started out with stupid, crazy, and demons. Look how far we've come. Just because we still have a long way to go, still, doesn't mean we should throw in the towel!