Here is my take. IF he is not a radicalized Islamic fanatic then there is the possibility that this was his version of a temper tantrum. My hunch is that he has recently faced a rejection of some kind ( i.e. has been told no.) This could be either personally or professionally. His sexual orientation only matters in the extent that it would increase his sense of entitlement and thus increase his anger at the possible rejection. In essence it is the behavior of a two year old who is told no. How dare you tell me no.... I’ll show you.
Now I am not a psychologist, but I am a nurse and a mom to four kids who has traveled the world and met many different people along the way. It is my best guess.
If he had shot up a school because of his mental condition, we would be talking about firearm laws instead of what caused his mental condition.
The rejections that homosexuals encounter are ten times worse than heterosexual ones. Who knows, there may have been some issue between these two pilots.
I agree, something set this guy off, and it might have been like spontaneous.