Locking someone up against their will for being suicidal will always be wrong in my mind.
You're entitled to that opinion, of course.
Contemporary thinking, including that of the mental health care profession, is that thoughts of suicide are the product of illness, and that treatment options are available. Terminal illness or chronic suffering are an exception. If someone has an illness which causes them to harm themselves, it seems appropriate to intervene when no alternative options are available.