“And when they came unto the borders of Jordan, that are in the land of Canaan, the children of Reuben and the children of Gad and the half tribe of Manasseh built there an altar by Jordan, a great altar to see to.
And the children of Israel heard say, Behold, the children of Reuben and the children of Gad and the half tribe of Manasseh have built an altar over against the land of Canaan, in the borders of Jordan, at the passage of the children of Israel. And when the children of Israel heard of it, the whole congregation of the children of Israel gathered themselves together at Shiloh, to go up to war against them.” (Joshua 22:10-12)
When they returned to their lands, the Trans Jordan tribes built a huge altar next to the Jordan River. God had given commandment that they were to bring their sacrifices and offerings to the Tabernacle in Deuteronomy 12:5-7. “But unto the place which the LORD your God shall choose out of all your tribes to put his name there, even unto his habitation shall ye seek, and thither thou shalt come: And thither ye shall bring your burnt offerings, and your sacrifices, and your tithes, and heave offerings of your hand, and your vows, and your freewill offerings, and the firstlings of your herds and of your flocks: And there ye shall eat before the LORD your God, and ye shall rejoice in all that ye put your hand unto, ye and your households, wherein the LORD thy God hath blessed thee.”
The huge altar looked like the Trans-Jordan tribes were turning away from God to the rest of Israel. Remembering the results of Achan’s sin, and of other sins, they gathered an army to come stop them by force if necessary. They did not want to experience the consequences of allowing sin in their midst. I Corinthians 5 warns of similar danger for Christians.
“And the children of Israel sent unto the children of Reuben, and to the children of Gad, and to the half tribe of Manasseh, into the land of Gilead, Phinehas the son of Eleazar the priest, And with him ten princes, of each chief house a prince throughout all the tribes of Israel; and each one was an head of the house of their fathers among the thousands of Israel.
And they came unto the children of Reuben, and to the children of Gad, and to the half tribe of Manasseh, unto the land of Gilead, and they spake with them, saying, Thus saith the whole congregation of the LORD, What trespass is this that ye have committed against the God of Israel, to turn away this day from following the LORD, in that ye have builded you an altar, that ye might rebel this day against the LORD?
Is the iniquity of Peor too little for us, from which we are not cleansed until this day, although there was a plague in the congregation of the LORD, But that ye must turn away this day from following the LORD? and it will be, seeing ye rebel to day against the LORD, that to morrow he will be wroth with the whole congregation of Israel.
Notwithstanding, if the land of your possession be unclean, then pass ye over unto the land of the possession of the LORD, wherein the LORD'S tabernacle dwelleth, and take possession among us: but rebel not against the LORD, nor rebel against us, in building you an altar beside the altar of the LORD our God. Did not Achan the son of Zerah commit a trespass in the accursed thing, and wrath fell on all the congregation of Israel? and that man perished not alone in his iniquity.” (Joshua 22:13-20)
Before attacking, Israel sent Phineas and a leader from each of the other tribes to confront the two and a half tribes with what they were doing and remind them of the consequences of the adultery with the Moabite women at Peor, and of Achan‘s sin at Jericho. They even offered to give them land on the other side of Jordan if that was what was needed for them to stay true to the Lord. They were hoping to avoid having to fight and perhaps kill the Trans-Jordanians.
The approach is the same as that prescribed by Christ in Matthew 18:15-17. “Moreover if thy brother shall trespass against thee, go and tell him his fault between thee and him alone: if he shall hear thee, thou hast gained thy brother. But if he will not hear thee, then take with thee one or two more, that in the mouth of two or three witnesses every word may be established. And if he shall neglect to hear them, tell it unto the church: but if he neglect to hear the church, let him be unto thee as a heathen man and a publican.” Putting people out of the church, like attacking the two and a half tribes, is to be avoided, if possible. If people refuse to repent, it is necessary, as described in I Corinthians 5.