Notice that Israel never deserved God’s salvation. It is only by His grace that Israel enters the Promised Land. Salvation by grace not works is the Old Testament doctrine too.
As they reach the end of their journey, Moses reminds them of the Lord’s fences and boundaries that He laid out. The Edomites, Moabites and Ammonites were off limits (at this point). God says very clearly, “Do not contend with them, for I will not give you any of their land,”
It’s not that these people were okay with the Lord so He was protecting them. There would be war between them and Israel in time.
But there would also be hope.
Ruth, the great-grandma of David, was from Moab. A gentile, grafted into the vine that is Jesus (John 15).
Sometimes God’s plans for us don’t seem logical or beneficial. Sometimes He seems to be protecting or holding us back from righteous deeds against the unjust workings of those around us.
We can’t know the depth of God’s plans, His infinite mind, His planning from before the foundation of the world.
But we can trust Him. Place our trust in Him. A daily active trust.
And we can know what He has told us. So much wisdom is in His word to discover and grow deeper into.
“Trust in the LORD with all your heart, and do not lean on your own understanding. In all your ways acknowledge him, and he will make straight your paths.” Prov 3 v5-6