Why Did an All-Knowing God Create Satan If He Knew It’d Be a Mess?

Why would an all-knowing God create the being who became Satan? Scripture distinguishes divine foreknowledge from creaturely responsibility.