After hearing and reading about the bits and pieces of information gleaned from the press investigations of Dr. Hasan, I would like to post a possible scenario in which the Major's action could be plausible, at least to a distraught individual. For what it's worth here is what I think the motive was for the shootings.
Dr. Hasan joined the Army ROTC while at Virginia Tech. He made a deal with the ARMY to put him through school for a six year stint in the regular Army upon his completion. After 9/11 and after completing his training, he petitioned the Army to be discharged and offered to repay the Army for the educational expenses.
Dr. Hasan complained of discrimination based upon his religion
and became bitter about his treatment and the treatment of the Iraqi civilians during the US invasion and occupation of that country.
As a psychiatrist he heard the stories of the atrocities of both sides from the returning Soldiers. I am sure that there were many stories about what the solders did or observed resulting in civilian casualties. Also, the Iraqi people were referred to by the soldiers in derogatory religious slurs.
When he received his orders for deployment he most likely was horrified that he would now be tacitly responsible for these same atrocities against the Afghanistan civilians in the war.
He was a devout Muslim and he would now be asked to fight against the Muslim's and this was a serious emotional conflict. Dr. Hasan has written about how suicide was not justified in any situation, yet he was at a point that to be true to his religious beliefs he would have to take some decisive action.
It was obvious that he did not plan to return to his apartment after going on post Thursday and gave all indications, save for the lack of suicide note, of committing suicide but couldn't because of his stated beliefs about taking one's own life.
The final result, in my opinion, was that Dr Hasan had to declare a Jihad against his own countrymen in the name of saving lives of his Muslim brothers. He knew that by shooting US soldiers he, himself would be shot and killed and by dying this way he could become a martyr in his faith, the only acceptable way of killing himself but not by his own hand.
This scenario would be logical in the mind of a man who could not find a legal way to be discharged from a war that he disagreed with on moral grounds and could escape his situation with glory in his religious beliefs.