In Joshua 6:26, Joshua had pronounced an oath, saying that anyone who rebuilt this city, the city of Jericho, would incur the Lord's curse. Either Eglon was oblivious to the curse…or his occupation of this site represented a deliberate act of defiance against Israel and their God. The former seems likely.
1
13 He gathered to himself the Ammonites and the Amalekites, and went and defeated Israel. And they took possession of the city of palms.