Because the definition of greatest good requires suffering as a necessary means.
I mean, one could also ask "Why didn't God define circles and squares in such a way that a square circle could exist?
That, in essence, is what you're asking.
The answer to that is that God created this world in order to express His loving-kindness. In order for that to happen their needs to be a recipient. Well, what would be the greatest thing God could give to someone? Technically, He would be the greatest good that He could give.
However, He wouldn't be able to make more gods because the definition of a God requires self-sufficiency. So, the best thing He could do would be to allow us the ability to become as much like Him as possible.
Well, God is an independent and self-sufficient being. Therefore, the only way He could make us like Him would be to give us independent self-sufficiency. This is done by allowing us to have free will. In order for our free will to exist, there has to be a dichotomy. We have to perceive a dichotomy between two options in order for it to be free will.
That being said, suffering/evil acts as a way to contrast good in order for our free-will to be maintained. In essence, suffering is the necessary means for the greatest good (which is our being able to make our own decisions and as a result being like God).