An important aspect of this question (one which was probably not intended) is that mental health has been used by oppressive societies as an excuse to mistreat people. For that reason, it seems unwise to make any generalizations based on fitness of mind. I suppose in a free society, the "harmless" would be "rounded up" and taken care of by charities. However, the clearly insane (say, criminally insane) may need to demonstrate their capacity for harming others before anything could be done about them, and the question of what to do would be vexing.