King Leoric had many people tortured in these halls as he descended into madness before his death, and they have now been commandeered by the Coven for the horrific rituals they use to summon demons and fuel their magic.
After going through the first two levels of the Halls of Agony, the player will be led outside and follow a path that leads to The Cursed Hold, Leoric's main prison, where the ghosts of Queen Asylla and her servants beseech you to set them free from their eternal torment. After fighting through that area, a stairway leads down to the third and final level of the Halls. From there, one must fight one's way through to the Chamber of Suffering where The Butcher, the final boss of Act I, awaits. Beyond the Chamber lie the Cells of the Condemned, the final area and your main goal.
The player travels through these halls as part of the quest The Imprisoned Angel, the final quest of Act I, which has the player seeking to stop Maghda and save The Stranger. This area must be explored in order to complete the achievement There Will Definitely Be Blood.