It sounds like Abdulazeez thought of this world (Dunya) as a prison and shooting these Marines as some sick Islamic test he needed to pass in order to be freed from it:
DAILY BEAST – The killer of four U.S. Marines in Chattanooga maintained a short-lived blog that hinted at his religious inner life. Mohammad Youssef Abdulazeez’s blog had only two posts, both published July 13 and written in a popular style of Islamic religious reasoning.
The first post was entitled “A Prison Called Dunya,” referring to the temporal world. In it, Abdulazeez uses the hypothetical example of a prisoner who is told he would be given a test that would either take him out of his earthly prison—or send him into a more restrictive environment.
“I would imagine that any sane person would devote their time to mastering the information on the study guide and stay patient with their studies, only giving time for the other things around to keep themselves focused on passing the exam,” Abdulazeez wrote. “They would do this because they know and have been told that they will be rewarded with pleasures that they have never seen.”
This life is that test, he wrote, “designed to separate the inhabitants of Paradise from the inhabitants of Hellfire.”