SPOILERS FOLLOW.
Why does Tommen commit suicide?
I've seen many people comment that Tommen's suicide was surprising and assume he did it because of Margaery's death. While I do agree that his wife's unfortunate demise probably played a part in Tommen's decision to end his own life, I would argue that his love for Margaery was only one facet in the deluge of emotion that the young king must have experienced watching the Great Sept of Baelor explode. Here are a few other thoughts I would bet were going through his mind.
1. The Twin Pillars
"The Faith and the Crown are the twin pillars upon which the world rests."
This is Tommen's modus operandi in season 6. We saw previously that Tommen was essentially good-natured, and generally wanted to be a kinder, fairer king than his brother Joffrey. Season 5 saw Tommen emasculated and proven to be a token figurehead. Helpless to rescue his wife, brother-in-law and mother from the newly-empowered Faith Militant, Tommen could do little but recognize the limits of his power even as King. If he couldn't save his family, if he couldn't control King's Landing ... how could he rule the Seven Kingdoms?
His status as a token figurehead only played into the High Sparrow's (and to some extent Margaery's) manipulations in season 6. With their words in his ear, naive, easily-manipulated Tommen fell for the High Sparrow's spiel, hook line and sinker. The burden of ruling wasn't on his shoulders alone now; he had the twin pillar of Faith on his side. The Faith that had - up until his conversion - been an enemy, now was an ally. Tommen's speech uniting the Faith and the Crown had saved his beloved wife from a humiliating walk of atonement. His announcement was greeted with thunderous applause by the masses.
Finally, Tommen had done something right.
All that was undone as the Sept exploded. One of the pillars of the world had collapsed. Only he remained.
2. The Mother's Mercy, the Mother's Treachery
It was not lost on Tommen that it was his mother's personal undead Mountain who stopped him from joining his wife at the sept. If Cersei had dispatched anyone else, perhaps it might not have been so obvious ... but Gregor Clegane blocking his passage could mean only one thing - Cersei did not want him at the Sept. As wildfire consumed the Faith's pillar, it became clear to Tommen that his mother had orchestrated the bombing. His mother was responsible for the death of not only his wife, but of all the men and women present. His mother had destroyed the Faith Militant ... and in so doing had betrayed him and his singular accomplishment as King.
We can note that Tommen's suicide was not accompanied by tears or despair. Rather, he strode to that window with resigned purpose. His mother had simultaneously extricated herself from a terrible situation and exacted a terrible vengeance on her enemies in one fell swoop. It was as if Tommen knew the only way he could do the same was to take that final leap.