John the Baptist was a prisoner of Herod and was ultimately beheaded because he reminded Herod of a past sin that he could not get beyond. We do not have to be haunted by sin because we have the great Sacrament of Reconciliation.
Based on Matthew 14:1-12:
Herod the ruler heard reports about Jesus; and he said to his servants, ‘This is John the Baptist; he has been raised from the dead, and for this reason these powers are at work in him.’ For Herod had arrested John, bound him, and put him in prison on account of Herodias, his brother Philip’s wife, because John had been telling him, ‘It is not lawful for you to have her.’ Though Herod wanted to put him to death, he feared the crowd, because they regarded him as a prophet. But when Herod’s birthday came, the daughter of Herodias danced before the company, and she pleased Herod so much that he promised on oath to grant her whatever she might ask. Prompted by her mother, she said, ‘Give me the head of John the Baptist here on a platter.’ The king was grieved, yet out of regard for his oaths and for the guests, he commanded it to be given; he sent and had John beheaded in the prison. The head was brought on a platter and given to the girl, who brought it to her mother. His disciples came and took the body and buried it; then they went and told Jesus.
(New Revised Standard Version Bible: Anglicized Edition, copyright © 1989, 1995 National Council of the Churches of Christ in the United States of America. Used by permission. All rights reserved worldwide. http://nrsvbibles.org)