I never could understand why God made that snake and the apple tree, when He knew exactly what was going to happen.
This is a common misunderstanding about predestination. Note that His 'knowing' what would happen did not cause it to happen. He gave them the gift of free will and they exercised it. Had he not given them that gift then we would be no different from the animals who follow instinct not free choice. What great love He has for us!
He loves us so much that He always respects our freedom to love Him and each other. Or not. If we were not free to reject, we could not be truly free to love, either. Oh, happy fault, that merited so great a Savior! (Exultet)