They followed the advice of Josh. 24:15, "Choose ye this day ..."
This is an interesting passage indeed.
15 And if it seem evil unto you to serve the Lord, choose you this day whom ye will serve; whether the gods which your fathers served that were on the other side of the flood, or the gods of the Amorites, in whose land ye dwell: but as for me and my house, we will serve the Lord.
16 And the people answered and said, God forbid that we should forsake the Lord, to serve other gods;
17 For the Lord our God, he it is that brought us up and our fathers out of the land of Egypt, from the house of bondage, and which did those great signs in our sight, and preserved us in all the way wherein we went, and among all the people through whom we passed:
18 And the Lord drave out from before us all the people, even the Amorites which dwelt in the land: therefore will we also serve the Lord; for he is our God.
19 And Joshua said unto the people, Ye cannot serve the Lord: for he is an holy God; he is a jealous God; he will not forgive your transgressions nor your sins.
20 If ye forsake the Lord, and serve strange gods, then he will turn and do you hurt, and consume you, after that he hath done you good.
21 And the people said unto Joshua, Nay; but we will serve the Lord.
22 And Joshua said unto the people, Ye are witnesses against yourselves that ye have chosen you the Lord, to serve him. And they said, We are witnesses.
When God tells the incompetent wretched depraved human to do good, He lays a snare for the self-righteous. For He will have mercy and not sacrifice. A contrite spirit quenches the fiery anger of the Lord. God hates those who seek their own righteousness. "Thank you Lord for not making me like this publican. I tithe, I fast...."
And his disciples remembered that it was written, The zeal of thine house hath eaten me up.
1 Brethren, my heart's desire and prayer to God for Israel is, that they might be saved.
2 For I bear them record that they have a zeal of God, but not according to knowledge.
3 For they being ignorant of God's righteousness, and going about to establish their own righteousness, have not submitted themselves unto the righteousness of God.
For thus saith the high and lofty One that inhabiteth eternity, whose name is Holy; I dwell in the high and holy place, with him also that is of a contrite and humble spirit, to revive the spirit of the humble, and to revive the heart of the contrite ones.
For all those things hath mine hand made, and all those things have been, saith the Lord: but to this man will I look, even to him that is poor and of a contrite spirit, and trembleth at my word.