Hate and rage comes from a deep dark place where chronic pain and emptiness lead people to act in destructive ways. When horrific things like this happen we often look desperately for some sense of an explanation. Those causes are likely many but at the root seems to stem from the same mental health issues. As our science advances we are likely going to find better ways of dealing with mental health problems and help people before such atrocities occur.
At the moment we are left with gaps in our understanding on how to handle and manage hate driven violence. It makes no difference what race, religion, ethnic, etc... of the perpetrator as the damage is felt in different communities. An investigation will help determine motive and whether it was a hate based crime and/or something else (...personally I'm seeing this as having another root cause🤷).
What we do know already is that there were prior mental health issues and a bent towards the use of violence to solve problems. The intent to commit violence is based in the pre-frontal cortex activities. It is possible to stimulate the prefrontal cortex to limit violent tendencies. (HERE). Thus the problem may be psychological and/or biological determinants that can be explored.
What we may end up seeing is that early intervention is important. Once someone is in contact with the criminal justice system we need the mechanisms to assess mental health issues and find referrals out to people who can help them. Perhaps we can avoid future violence through proper coding, research and intervention. You can see an idea I thought of for Michigan....Counseling and Coding Hate Crimes