As noted previously, Israel’s obedience to the covenant stipulations bookends this book. The importance of obedience is stressed in the body of the book through examples of Israel’s disobedience (e.g., Achan, the Gibeonites).
If Israel was to live out its purpose for living in the land—showing the nations what good and wise dominion of the earth looked like—it had to live in obedience to the covenant.
Ominously, Joshua closes the book by telling the people that they will not be able to serve the Lord (Josh. 24:19).