From what I've read, this killer had essentially no previous criminal record at all.
He probably acquired the weapons he owned legally.
Sadly, in a nation of over 300 million, incidents like this have become "the price we pay" for having a Second Amendment.
That is to say, with the right to own weapons guaranteed by the Constitution, every now and then someone who owns them is going to go completely bonkers and commit an atrocity like this.
Once they have, there's nothing left to do but clean up the misery they leave behind, and wring our hands and consciousness wondering "how could this have happened"?
But there's little that can really be done to prevent it from happening again.
You can turn churches, synagogues and schools into fortresses, and it will still happen.
Again -- it's a "price to be paid".
Nothing more. Nothing less.
"The bill" falls due now and then, and nobody likes it.
But.. we still have to pay.