I’d say there is or should be a distinction between sacrificial suicide and not. If you are killing yourself to prevent information getting out, or even to prevent a gruesome torture where you’d likely die anyway, then that may be morally correct. If you are down on your luck and take your own life it’s definitely less so and we should actively prevent this when possible.
Of course you could make the argument some people’s lives are gruesome just due to being alive, such as people dealing with great amounts of pain or just getting a bum wrap all around since birth, and this is the reason Ethics is the only class I ever dropped.