In where I live (which is a successful little Asian country always mistaken to be part of China), it is an offense to kill yourself, or to attempt to kill yourself. If you try to kill yourself and fail, you face legal consequences.
The following opinion is a personal one:
Why? It is both a means of punishment, and a means of prevention. We punish those who try to kill themselves because it is irresponsible to do so – the economy and society suffers and becomes less efficient in the market and in the society. We prevent people from trying to kill themselves since they would incur a criminal record and a fine/sentence if they fail to kill themselves successfully (which means it sieves the people who are pretending to be suicidal from the people who are truly suicidal – pretend suiciders wouldn’t dare pretend since there is a punishment in so doing).
All this… I think its a fine system. It is efficient – but it is not empathetic.
I have a very promising future ahead of me (admittedly, I am one of the top 10% ‘elite’ in my country), but I have a very depressing past. I attempted suicide and now I have a legal consequence to bear – which means my very promising future has morphed into a looming dread. This makes me want to continue less. This makes me want to give up more. And this, of course, makes me rethink the system in place – it is not full proof. Its prevention functions are fine, but its punishment functions are counterproductive. Yet, prevention and punishment are intertwined in this system.