God knew.
God knew what the Israelites were thinking.
God knew that when they entered into the land flowing with milk and honey, and they have eaten
and were satisfied and became prosperous, then they would turn to other gods and serve them,
and spurn Him and break His covenant (Deut. 31:16-20).
Moses knew the Israelites’ rebellion and their stubbornness.
He knew that after his death they would act corruptly and turn from the way which he had commanded them;
and evil would befall them in the latter days, for they would do that
which was evil in the sight of the Lord, provoking Him to anger with the work of their hands (vv. 27-29).