Blame it on Adam and Eve’s free will.
And that is exactly the premise of a wonderful little book titled: “Why do bad things happen to good people”.
God gave us free will as we were made in his image. (I think I read somewhere else that the angels did not have this - though I don’t know of any scriptural basis for it). But with that free will, Eve and then Adam choose wrongly resulting in a sinful nature in mankind.
The other answer is that there can be no good if there is no bad. What is good if there is no bad? How would one know? Since God is perfect he would not create 1/2 of something, but the whole.
Using that logic you could blame Ford Pintos for exploding in rear end collisions.