This is sorta the beginners philosophy question. There are plenty of answers, it's not the "gotcha" it appears to be. Those answers unroll into all sorts of branching other conversations but they exist.
Maybe it's because free will exists.
Maybe there's a greater purpose for what we call "evil" that results in more good.
Maybe it's a definitional thing, where "evil" to us is always going to be the most-evil existent thing so if existing evils were gone "evil" would still exist but it would consist of aggressive kitten licks or something. So "evil" can't not exist, but it's not because God can't get rid of what we call "evil" now.
Maybe there's a greater purpose for what we call "evil" that results in more good.
A work of fiction I very much enjoy called UNSONG uses a variant of this as the answer to the question of evil. The basic notion being that at the level of abstraction that God operates at two identical things are essentially one thing and so in order to maximize the total net good he creates universe upon universe, all slightly different but each ultimately resulting in more good than bad in net. The universe the story takes place in is recognizably similar to ours until the Nixon administration, and it is explicitly said to be "far from the center of the garden". IOW in a region of possibility space in which few potential universes are good on net.
The story is also an absolute master class in foreshadowing to the point that if you just listen as the story repeatedly tells you how one should interpret text, you can derive the ending from like the first paragraph of chapter 1 by just digging deep enough. And it goes a lot deeper than that. It's not just an aesthetic choice that every chapter name is a Blake reference, or that the story is arranged into groupings of four, ten, twenty two and seventy two. It also manages to analogize itself to both the works of William Blake and the song American Pie because why not?
What annoying when people who have no grasp of what philosophy about starting saying these statement and expect me to answer them.
Edit: reading the comment is also annoying. When someone mention God, many assume the statement reference their own religion and draw conclusion based on it. I had someone start talking about god doesnt exist because “the proofs” are wrong, but these proofs all driven from his own religion. ( ex christian talking about statement that doesnt make sense in the bible) when I attempt to speak on higher level ( forgot all religions lets talk about god as an entity or thought ) they kept circling around to same points.
Many people dont know how to debate or what they are debating.