There are several reasons why these kings would attack Gibeon. Gibeon was on their doorstep. For them to go to Gilgal, they would have to first pass by Gibeon. Maybe they also thought that in destroying Gibeon, they would send a sign to the rest of the Canaanite cities to dissuade them from forming alliances with Israel.1
4 “Come up to me and help me, and let us strike Gibeon. For it has made peace with Joshua and with the people of Israel.”