Why did God create Adam and Eve so that they would sin? According to If Adam and Eve were perfect, why did they choose to sin? the serpent tricked Eve into eating the apple.

So either the serpent or humans sinned because of free will. But God is sovereign which means he defined exactly what free will is and also knows the outcome of every variation. He still chose the variation which eventually resulted in sin.

It seems to me like God wanted them to sin. He is almighty and could create humans who won't sin even if they had free will. It's not the free will which made them sin but the emotions and wills which God also gave them.

So why did God create Adam and Eve so that they would sin?
You are not the first thoughtful person ever to have thought what you think about the 
"free will of man" and the sovereignty of God. (I put the free will of man in quotation marks, because I think it more accurate to say "man's ability to decide," or "man's ability to make decisions." The only will which is truly free belongs to God, and He alone is free to do whatever He wills--anything, that is, which is in keeping with His character.) 

Years ago I read Arthur W. Pink's book, The Sovereignty of God, and I remember being introduced to the term antinomy. Antinomy is defined as "a contradiction between two statements, both apparently obtained by correct reasoning." 

If memory serves, Pink suggested that "free will" and God's sovereignty comprise an antinomy which cannot readily be explained--if ever! His "answer" (again, if memory serves) may seem like a cop-out, but it may be closer to the truth than one might at first think. 

Verses such as Isaiah 55:8 and 9 should give us pause in this regard:


  "'For my thoughts are not your thoughts, Nor are your ways My ways,' declares the LORD. For as the heavens are higher than the earth, So are My ways higher than your ways And My thoughts than your thoughts'"(NASB, Updated Edition).


God is infinite. God inhabits eternity. We are finite. We inhabit time. Not to be flip or irreverent, but "apples and oranges." 

God's sovereignty and His foreknowledge do not MAKE things happen. From our Monday-morning-quarterback armchair, we critique God's game and say, "Boy, if I were the quarterback I would have done things differently," and then go on to explain how and why we'd do things differently if we were G--I mean, the quarterback! Doesn't work that way. 

God, of course, knows the end from the beginning and the beginning from the end. That is why He is called the Alpha and the Omega (see Revelation 1:8, 21:6, and 22:13). God, unlike us, has no time constraints. Since He knows what is going to happen well in advance of when it actually happens, He can "plan ahead," as it were, to cover all contingencies. (This last sentence is outrageously humanistic and perhaps even hyperbolic, but I include it simply to illustrate a truth.)

God's planning ahead includes His plan of salvation, and we need to thank Him and be in awe of Him for that very reason. As the hymn writer put it:


  O, the love that drew salvation's plan,
  
  O, the grace that brought it down to man,
  
  O, the mighty gulf that God did span
  
  At Calvary


His plan was not a spur-of-the-moment thing; no, it originated in the eternal counsels of God (see Revelation 13:8, Ephesians 1:11, and 1 Peter 1:20). In a sense, Christ's death on behalf of Adam and his fallen race was a fait accompli (my translation: "a done deal") even before Jesus was conceived of the Holy Spirit in the womb of the virgin Mary!

I suggest the central question you seem to have in mind could be paraphrased as follows:


  Does God's knowing something will happen, make it happen?


I suggest the answer is no; it does not. The only person to whom my answer truly makes sense is God Himself; again, because we are creatures of time. Our perspective is constrained by what happened in the past, not by what might happen in the future. Oh, we can appreciate, intellectually, the concept of "the eternal counsels of God," but in actuality our intellectual appreciation falls far short of the mark of God's perfect understanding of His eternal counsels.

Years ago, my godly father suggested to me that God inhabits the eternal present. That makes sense to me. God does, however, accommodate us finite critters by revealing His truth in terms of past, present, and future. Those constructs are just that: constructs. Believe it or not, there was a "time" when the only person who existed was God, and if it weren't for the love of God which "drew salvation's plan," God would not have created the angels or us, His image bearers. 

So we've come full circle. God's thoughts are not our thoughts, and God's ways are not our ways. As far as north is from south, and as far as east is from west, so far are God's thoughts and ways beyond ours. The expression "hindsight is 20/20" may be fairly accurate as touching human affairs, but as touching God's plans and purposes, the expression simply does not work, nor could it ever.