Extremely diverse ecosystems lead to a diversity in molecules. So it’s not only that there’s so many plants, but that there’s so many plants (and animals) that are competing. This drives evolution and diversification. And as @syz mentions, this also drives competition, and many of our medicines are in fact toxic substances in the proper doses, so their weapons become our medicines. More competition, more evolution, more useful substances.
There’s also the fact that it is so dense, and thus not well explored by humans. There’s potentially thousands, if not hundreds of thousands, of species we have no knowledge of, any one of which may have something new that’s useful. Most of the inhabited landmasses have been well explored, and so the chances of finding anything new, while not nothing, are much lower than the chance of finding something amidst the teeming unknowns of the Amazon.
Perhaps we should work on not destroying it so much.