There is a tradition that an object that has been used for a mitzvah is holy and should be used for another mitzvah, or at least not simply discarded. (People do all sorts of good things with old tzitzit, lulavs and etrogs, etc.) Similarly, an object that has been used for evil should be destroyed. For example, the Torah explains that if an ox gores and kills a person, the ox itself must die. (Exod. 21:28-29) Certainly the ox is not being punished for his moral culpability; he is being destroyed because he was the cause of someone's death.
The idea here is that non-human things can take on certain normative qualities. They can in some limited way be holy or unholy, good or evil, objects that elevate or objects that denigrate. Mystics would ascribe supernatural characteristics to these things. I am more this-worldly, and I view this in terms of the meaning or attributes we ourselves ascribe to these objects.
Our midrash picks up on this idea and expands upon it. In this midrash, Haman pleads with Mordecai not to hang him from a tree, but Mordecai refuses. At that point, an argument breaks out among the trees as to which tree must bear the burden of having Haman hang from it. Each tree says no. The gravevine, fig tree, olive tree, palm tree, etrog tree, myrtle, oak, terebinth and pomegranate trees all explain why they should not have Haman hanging from them. Finally, the cedar says "hang Haman on me, on the tree that he in fact prepared for himself."
(For some reason, I seem to get all the midrashim involving trees with attitude.)
First, a quick clarification. This midrash comes from Targum Sheni, a later collection of midrashim on the Book of Esther. It is not clear from our text what precisely the cedar meant by "for himself." Did Haman prepare the tree for Haman? And if so, in what way? I was unable to find an on-line version of Targum Sheni to check this. However, after poking around the web a bit, it looks like Haman had prepared a ceder tree in some way to hang Mordecai. That makes sense, but it is not readily apparent from our text.
So here we have an object (the cedar) that was going to be used for a bad purpose (hanging Mordecai) but instead was used for a good purpose (hanging Haman). Apart from pleasant parallelism, why should this be? Why not hang Haman anywhere?
Importantly, Mordecai was not in fact hanged from the cedar, and so the tree was not actually used for bad purposes. (If it had been, I assume the tree would have been detroyed.) The cedar had only potential evil, not actual evil, associated with it, and so it not only was not destroyed, but could be used for good purposes.
Unlike objects, people can make moral choices. But some of the lessons from these animals and objects apply to us as well. Potential evil is a relatively easy thing to turn around: simply do not do it, and instead do good. But once we do wrong, it is much harder to turn things around. After all, if we had been objects or animals, we might have actually been killed or destroyed. But since we are not animals or objects, but instead are moral agents, we can repent and do t'shuvah.