Since he blew himself up near a group of Sunni pro-government fighters, it is unlikely that he was a Shi’ite, since the government in Baghdad is Shi’ite. He is more likely to have been a partisan of the Islamic State. In any case, the justification for this behavior is in the Qur’an, which promises Paradise to those who “kill and are killed” for Allah.
“Suicide bomber kills 33 people south of Baghdad,” Reuters, December 24, 2014 (thanks to Kenneth):
Baghdad: A suicide bomber killed 33 people and wounded 55 others in Madaen, about 25 km (15 miles) south of Baghdad, on Wednesday, Iraqi police and medical officials said.
The bomber blew himself up near a line of Sunni pro-government fighters waiting for their salaries, the officials said, adding they expected the toll to rise. The dead were mostly pro-government fighters, but included at least three soldiers.
“The attacker was wearing an Iraqi army uniform, and an explosive vest packed with ball bearings,” a police officer said.