Of course He knew what Satan would become. And He knew that man would follow him.
Why did He allow it? What would the alternative be? Eternal bliss, unearned and entirely without contrast? I don’t claim to know God’s thinking on all things, but He never struck me as the type to create an endless utopia inhabited by spoiled immortals who never knew anything but absolute euphoria. He’s the Lord, not mankind’s sugar daddy.
I’ve struggled with a lot of theological questions over the years, but the “why does God let bad things happen” question (which your Satan question is a variant of) was never really one of them. The answer always seemed fairly obvious.
The Bible also says that God had planned the death and resurrection of Jesus since before the foundations of the Earth were laid.
I highly doubt God was surprised by Lucifer’s attempted insurrection.