The shooter could have been having a psychotic episode.  He is in the age group of onset of mental health problems like schizophrenia or bipolar disorder.  Mental illness and guns are not a good combination.