If God knew Adam and Eve would succumb to temptation, why did he let them be tempted in the first place?
God wanted our relationship with him to be based on mutual unconditional love. At its core, love is the entwining of two wills.
For this type of love relationship to be permanently established between God and humanity, Adam and Eve had to conform their malleable wills to his perfect will.
God’s command to not eat the forbidden fruit gave them the opportunity to entwine their wills with his. Implicit in this command was the temptation to eat the fruit, as well as the freedom to act on the temptation and disobey the command.
God knew beforehand that Adam and Eve would make the wrong decision. He foresaw the resulting damage to his creation. He knew Jesus would have to die for their mistake.
Yet God valued a love relationship with us so much that he risked virtually everything to make it possible. This is a remarkable concept!