This is the cause why Joshua did circumcise: all the people who came forth out of Egypt, who were males, even all the men of war, died in the wilderness by the way, after they came forth out of Egypt.
Why did God wait to command the circumcision of the new generation until now rather than on the plains of Moab? Perhaps He did so because He wanted to bring the people into the land before enforcing this aspect of the Law. This is consistent with God’s dealings with humankind. He first gives and then asks (cf. Romans 12:1).