Each time we have one of these horrific mass shootings, many people shake their heads and ask, "What on earth could make somebody want to do something like this?" In most cases, the perpetrator is dead and did not plan to survive the attack. This time we have a living perpetrator, so perhaps we will learn more.
I suspect that a strong desire to be in the headlines is part of the motivation. Too many young people place too much emphasis on being "famous" and have lost the distinction between being famous and being infamous. There is even a television series titled, "Murder Made Me Famous."
In December 1941, President Roosevelt famously declared that the 7th was "a day that will live in infamy." He didn't say "fame," and everyone knew the difference. The perpetrators would go down in history, but as villains, and that was universally regarded as a bad outcome for them.