The Lord did not cast the people out. Joshua and the people obeyed the Lord (somewhat) and cast the people out.