Was it buyer’s remorse? Had the tribes of Reuben and Gad realised what they’d lost by wanting to settle outside the promised land? Why did they build an altar to God on their way home, before crossing the Jordan back to their families?
It was a controversial thing to do. The other tribes were worried about what it could mean: were Gad and Reuben already turning towards idolatry? They sent an envoy to ask for the reason. The explanation:
Joshua 22:24-25 The truth is, we have built this altar because we fear that in the future your descendants will say to ours, ‘What right do you have to worship the Lord, the God of Israel? The Lord has placed the Jordan River as a barrier between our people and you people of Reuben and Gad. You have no claim to the Lord.’ So your descendants may prevent our descendants from worshiping the Lord.
The altar was a memorial, not a real altar for sacrifices and the like:
Joshua 22:28-29 If they say this, our descendants can reply, ‘Look at this copy of the Lord’s altar that our ancestors made. It is not for burnt offerings or sacrifices; it is a reminder of the relationship both of us have with the Lord.’ Far be it from us to rebel against the Lord or turn away from him by building our own altar for burnt offerings, grain offerings, or sacrifices. Only the altar of the Lord our God that stands in front of the Tabernacle may be used for that purpose