Actually, it's an argument that God is just and elegant despite the existence of Hell. So it would apply equally to Islam, and any other religion I don't know about that has a Heaven and Hell. But Islam and religions I don't know about are gay.
Hell is a problem for theodicy* because it's kind of an extreme form of punishment. How can anyone deserve unimaginable pain forever? It's more understandable, if not any more appealing, if you look at Heaven and Hell as not a reward and punishment, but as logical necessities. God can be excused for being extreme if He's bound by His only master, logic. In case your monocle popped out on that last sentence, let me try to ease your mind. If you believe logic is a universal law that even God must follow, then it shouldn't trouble you. If you believe logic is an invention of God, then think of it this way: God can choose to bind Himself to His own laws. He invented the laws of morality, and would never break them. Also, He issues commands to Jesus, while being Jesus. And Jesus is mankind's king and servant at the same time. There are apparently all sorts of circular chains of command in and about God.
So I'm going to say Heaven and Hell are a logical necessity. That "logic is an invention of God, which He bound himself to" problem might still be bothering you. You might ask, "Why would God invent the kind of logic that makes Hell necessary? That still seems rather mean." I wish I had an answer for that, but my brain's already twisted in a knot. Moving on.
Imagine a community of people who live forever. It's not as easy as it sounds. What kind of person would you be after living in another world, filled with constant joy (or pain), for 60 quadrillion years? That's just the beginning of eternity. But let's try to make predictions anyway. A good guideline would be to take something in this life that's a function of time, and setting the time factor to infinity. Take one of your relationships. Does it get better or worse with time? When the relationship encounters tension, do you react with hostility, causing more tension, or understanding, causing less tension? It's probably hostility sometimes and understanding other times, but we're looking for an overall trend. Multiply the trend by infinity, and that's what your relationship will look like in eternity.
Heaven is a community of people who live forever. If they're going to enjoy their infinite time together, they have to be the kind of people who react with understanding. They have to be the kind of people who can maintain good relationships. The kind built on love and kindness and all that shit. Those traits are requisite to get into Heaven not because God wants to reward you for them, but because Heaven just wouldn't work otherwise. And Hell would be the alternative for the unqualified. The annoying people have to go somewhere.
Infinity has a way of simplifying things. It might not be clear where your relationships are going. Or if it is, it might not be clear whose fault it is. But you'll find out when you die.**
*The branch of theology that deals with the problem of evil.
**If there are afterlives.