Thank you for the question, “Why did the princes tell the congregation that they could not touch the Gibeonites in the book of Joshua?”
The Gibeonites could not kill the Gibeonites because they made a treaty with a binding oath in the name of LORD, the God of Israel.
Joshua 9 says this, “The Israelites sampled their provisions but did not inquire of the LORD. 15 Then Joshua made a treaty of peace with them to let them live, and the leaders of the assembly ratified it by oath. 16 Three days after they made the treaty with the Gibeonites, the Israelites heard that they were neighbors, living near them. 17 So the Israelites set out and on the third day came to their cities: Gibeon, Kephirah, Beeroth and Kiriath Jearim. 18 But the Israelites did not attack them, because the leaders of the assembly had sworn an oath to them by the LORD, the God of Israel.
The whole assembly grumbled against the leaders, 19 but all the leaders answered, “We have given them our oath by the LORD, the God of Israel, and we cannot touch them now. 20 This is what we will do to them: We will let them live, so that God’s wrath will not fall on us for breaking the oath we swore to them.” 21 They continued, “Let them live, but let them be woodcutters and water carriers in the service of the whole assembly.” So the leaders’ promise to them was kept” (A searchable online Bible in over 150 versions and 50 languages)
Thus there were three reasons for not killing the Gibeonites:
A. The Israelite princes made a peace treaty with the Gibeonites.
B. The Israelite princes sealed the peace treaty in the name of the LORD.
C. The Israelite princes wanted to avoid the wrath of God by violating their oath to the Gibeonites.
SUMMARY: An oath given in the name of the LORD must be fulfilled and can’t be voided by the Israelites. One can’t bear false witness.