For the same kind of reason that they go to horror movies. Note that this only has to do with 'thinking of', not with thinking of committing, although such thoughts often start leading in that direction.
Note that thinking about suicide is not the same as thinking about suiciding yourself. I mean, "suicide" is taught in colleges and universities to people who are in class to learn about psychology and psychiatrics. They think about suicide without seriously ever thinking of doing it to themselves.