Do you remember what happens in Joshua 1:12-18? The Reubenites, Gadites, and the half-tribe of Manasseh promise to help the rest of the Israelites in battle, so long as their women and children and such can stay put on the eastern side of the Jordan.
All the rest of the Israelites live over on on the western side of the river.
Anyway, now that the war and allotments are over, and because these three tribes made good on their battle promises, they are allowed to return to their lands.
The Gadites, Manasseh and Reubenites all return home with their spoils and booty (1-9).
But then these three tribes decide to build an altar on the western side of the Jordan on their way home, and the Israelites on the western side are all like Oh no you didn't. They think this whole altar-building business is pretty offensive to God and get ready to fight.
Fortunately, someone has the foresight to let Phinehas the priest try to peacefully resolve this dispute.
He accuses the three tribes of blasphemy and rebellion by building an altar.
Pro tip: When trying to speak peacefully, do not accuse people of dishonor, blasphemy, and rebellion.
Phinehas mentions Achan from Joshua 7. He notes that Achan's whole family and belongings were destroyed for his sins.
The other Israelites are ready to kill these tribes (13-20).
The three tribes huddle together and claim that the altar was built as a memorial, not as a sacrificial place. Good save, guys.
The writers of Joshua want to emphasize to future generations that the proper place to sacrifice to God is at the temple in Jerusalem.
The three tribes explain that they built the altar to symbolize how the tribes are now part of a nation and do not stand alone. Phinehas and the tribes accept this explanation and return home.
High fives all around for averting a civil war (21-34).