I assume Tommen killed himself because he loved his wife and he knew that she was dead because he was a weak king who wasn't able to control anyone, including his mother. He feels like a failure as a king and decides that the only way to be back with his wife is to kill himself.