Hate, is rarely worth it
In the biblical account found in the book of Esther, King Ahasuerus (Xerxes I) hanged Haman in response to a series of events that transpired in his court.
Haman was a high-ranking official in the Persian court and had become the king's favorite. He was an Agagite, likely a descendant of the Amalekites, an ancient enemy of the Jewish people. Haman harbored a deep hatred for Mordecai, a Jewish man who refused to bow down to him, as explained in a previous response.
Haman's hatred for Mordecai led him to plot the extermination of all the Jews in the Persian Empire. He cast lots (purim) to determine the most favorable date for the annihilation, hence the origin of the Jewish festival of Purim. Haman then presented this plan to King Ahasuerus, who, without knowing the identity of the intended victims, approved the decree.
The critical turning point in the story came when Queen Esther, who was Mordecai's cousin and also Jewish, revealed her identity to the king and exposed Haman's wicked plot. King Ahasuerus was enraged that someone in his court would conspire to harm his beloved queen and her people.
In Esther 7:9-10, during a dramatic turn of events, the king returned to the room from the palace garden to find Haman falling on the couch where Esther was reclining. The king, seeing this act as an act of aggression against the queen, exclaimed, "Will he even assault the queen in my presence, in my own house?" This act further incensed the king against Haman.
One of the king's attendants, Harbona, then informed the king about the gallows that Haman had built to hang Mordecai. King Ahasuerus, in his anger and judgment, ordered that Haman be hanged on those very gallows. So, Haman met his end on the same instrument of death he had prepared for Mordecai.
Haman's fate serves as a lesson of divine justice and poetic irony, as the evil plot he devised to destroy the Jews ultimately led to his own downfall and execution. His death also marked the turning point in the story, leading to the salvation of the Jewish people, as the king allowed Mordecai to issue a counter-decree allowing the Jews to defend themselves against their enemies. The Jews were spared, and Haman's evil plan was thwarted, making him one of the Bible's most infamous antagonists.