So what happened? Why did this young man do this?
What went wrong with is thinking that he saw this as a good idea?
Lots of things, but essentially, “Herostratus complex”.
Herostratus - Wikipedia
“Herostratus (Ancient Greek: Ἡρόστρατος) was a 4th-century BC Greek arsonist, who sought notoriety by destroying the second Temple of Artemis in Ephesus. His acts prompted the creation of a damnatio
memoriae law forbidding anyone to mention his name, orally or in writing. The law was ultimately ineffective, as evidenced by mentions of his existence in modern works and parlance. Thus, Herostratus has become a metonym for someone who commits a criminal act in order to become famous.”
My feeling is, maybe, introverted personality, and the Internet, and the guns, and the mental illness, and likely, he did not take his meds, either...all of it.
But ultimately, he said it all himself - I see hopelessness and fear of the future, that causes suicidal thoughts. About own life, he does not care. But because he is a loner, he dreads the idea of no one noticing his funerals. His choice is to go with a bang - whatever happens, he got himself a line in Wikipedia. Today.
That his thinking is mean and irrational, and that he cruelly took the lives of 20 people, well, that goes with his odd-eccentric personality. This is how he views taking control over his life and death, going out on his own terms. (To add to it, this loner now got the club of admirers, it matters to him, as well).