Psychologists who study sociopaths and psychopaths will tell you a prime motivator is fame and publicity for these people. It's suicide by cop in a way that makes them infamous. The rise of the mass shooting follows closely with the rise of the 24 hour news cycle. Cut all mention of the perp and you will cut the frequency of these horrors. 

And on a related but different subject, the Texas perp was ineligible to own guns, according to US law. What would gun control have done to stop him? There already was gun control in place targeting him, and of course, he didn't pay attention to it. And in the wake of the rental VAN attack last month in NYC, there were more calls for, you guessed it, gun control. The willful ignoring of common sense and evidence by the anti gun lobby is staggering at times.