In Dallas Willard’s posthumously-published book on apologetics, The Allure of Gentleness, he describes why a loving God created hell:

Why Is There a Hell?

Many people simply do not want to be with God. The best place for them to be is wherever God is not, and that’s what hell is. The fundamental reality of hell is separation from God, and that comes about because people do not want to be with him. For those people, being with God is the worst thing that could possibly happen to them.

A part of our problem with understanding hell comes from the way we think about heaven. We think about heaven as some kind of comfortable resort, but the greatest thing about heaven is going to be the presence of God. He has allowed us to avoid him here on earth in some measure if we want to, but if you go to heaven, God’s the biggest thing on the horizon. You’re no longer going to be able to avoid him. And that would be the supreme torture if you haven’t gotten over thinking of yourself as God. That’s why I sometimes say that the fires of heaven burn hotter than the fires of hell.

Of course, it is not God’s will that anyone should perish. God is not trying to keep people out of heaven. He’s trying to get them into heaven. Some people think that God is sort of up there with his foot against the door, unwilling to let people in. Well, he is willing, but the issue is, can you stand to be there? And if you made it, would it be heaven to you, or would it be something much worse?

C.S. Lewis wrote: “There are only two kinds of people in the end: those who say to God, ‘Thy will be done,’ and those to whom God says, in the end, ‘Thy will be done.’ All that are in Hell choose it.”

Jesus was constantly trying to enfold people in his kingdom. He was not trying to send people to hell; he was trying to get as many people into heaven as he could. We need to understand that’s where God’s heart is.

God did not create hell because he’s mad, he wants to see people suffer, and he enjoys torturing them for eternity. The only reason there is a hell is because God makes provision for what people want, and hell is simply the best God can do for some people.