Can we legislate these types of crimes away? I don't think we can. We can make these things harder to get, but it is our right to have them (whether they're needed or not). The problem, IMO, is not that there are guns. There are lots of places in the world where people have guns and this kind of stuff is disproportionately rarer in those places.
Basically, I don't know what the **** to do, or what the hell our problem is. I just know that something has to be done. It probably should start with looking at mental health issues, making people more aware of the signs, and less afraid to seek help for them.