I need to preface my response by noting that I am not a licensed psychologist or even a mental health expert. My expertise lies in the areas of normal individual differences.

That said, my understanding of involuntary commitment is that the legal system (informed to some degree by psychology and psychiatry) makes judgments about whether a person lacks healthy control of their actions and is therefore likely to engage in serious self-harm or harm to others. Yes, it might seem that involuntary commitment contradicts psychologists' goal of autonomy for everyone. I suppose that the thinking if allowing that autonomy results in serious harm or even death, then the value of life outweighs the value of autonomy, and that hopefully after treatment autonomy can be restored.