We balance many difficult and inherently conflicting goals, such as:
1) minimizing treatment, which is expensive and does have bad side effects
2) sufficiently good access to treatment where it’s economical for prevention
3) fear of being wrongly hospitalized (error, political motivation, etc.)
4) sufficient ability to lock other people up for frightening or violent behavior in public
It’s a tough problem, but I think the tradeoffs are managed near optimally, granting that the rights and interests of the mentally ill don’t matter at all to most public officials or voters.