I think that what you are asking can be broken down into a few questions:
1. can things be perfect and imperfect at the same time?
2. how can everything be just fine when there is all this crazy shit going on in the world?
3. How can there be positive and negative karma if ultimately there is no duality in the universe?
If this is what you are asking then I think I could offer some answers based on my limited understanding. But I don't want to put words into your mouth, so if this is not what you are asking, can you help me to better understand your question?
I wondered if these questions more accurately described your question. From reading the subsequent posts, it appears that they do. So, here is my input:
You are right when you say "at core it is pure and so can be purified. The suffering itself, however, seems quite undeserved and therefore not so perfect." From the ordinary point of view, of course things are not perfect. They are not perfect for everybody and they have never been perfect. There is suffering. There has always been that constant striving. If suffering did not need to be ended, the Buddha would not have appeared in this world. It would have been pointless, and it would be pointless to practice dharma. So, the term, "everything is perfect" cannot mean that suffering is good.
I don't think that interpreting it as karma, or perhaps, as a fair distribution of pain and suffering is the correct interpretation either. So, when people think "everything is in balance because so and so must have deserved the suffering they got" that is not right. Karma is not a penal system. That approach still clings to duality.
The poem you shared is really quite excellent. The point is to understand emptiness. Where do victims get their suffering from? Because their suffering is an extension of the suffering of the perpetrator. A person causes another person to suffer because they themselves are messed up. That is their suffering. And the point in understanding is is from the view of the Dharma person who sees that all these beings are suffering and so does not choose sides, but responds appropriately.
If there was not suffering in the world, The Buddha would not have appeared, and there would be no human realm. Humans evolved from early primates who stood on their hind legs. Why did they do this? To avoid the suffering that comes from being eaten alive. Life evolves into different forms for purposes of survival. "Precious Human Birth" is the result of a lot of "kalpas" of of missed meals. Prince Siddhartha was born because, a few thousand years earlier, somebody did not end up inside the belly of a saber toothed tiger or something. It is all part of dependent arising. So, in terms of "the big picture" all the pieces fit together very nicely, like a jigsaw puzzle, and only fit together in such a way that the shape of the picture keeps changing constantly.
So, suffering exists and the perfect response is to end suffering. The two fit together without any duality.
There was a tv series many years ago called "The Power Of Myth" where Bill Moyers interviews Hustom Smith. In one episode, Smith is talking about the Christian symbol of the lion lying down with the lamb. This symbolizes a perfect world. Smith says that people misunderstand the meaning, and he reemarks "The lion still eats the lamb--but it's okay!"