The poem tells of Dante 's journey through the three realms of the dead , with the Roman poet Virgil guiding him through Hell and Purgatory , while Beatrice , who Dante was never permitted to marry in real life , takes him through Heaven .