Esther 5:8

5:8 If I have found favor in the king’s sight and if the king is inclined to grant my request and perform my petition, let the king and Haman come tomorrow to the banquet that I will prepare for them. At that time I will do as the king wishes.

Esther 5:14

5:14 Haman’s wife Zeresh and all his friends said to him, “Have a gallows seventy-five feet high built, and in the morning tell the king that Mordecai should be hanged on it. Then go with the king to the banquet contented.”

It seemed like a good idea to Haman, so he had the gallows built.