The Friar's soliloquy is important for a couple of reasons. First of all, it gives the reader a glimpse into the Friar's character and philosophy on life. Through his knowledge of plants, he has come to realize that good and evil exist side by side on Earth. Moreover, everything on Earth has the potential to become destructive if it is not used correctly.
We can apply this logic to the feud between the Montagues and the Capulets. Essentially, the Friar is saying that the rift between the two families can be healed because all things on Earth, even things that might seem evil, have a property that makes them special and precious:
For naught so vile that on the earth doth live
But to the earth some special good doth give.
If the families can find that special quality in each other, their feud can be healed. The soliloquy is, therefore, a metaphor for the war between the Montagues and Capulets.
In addition, this soliloquy foreshadows Juliet's death. Remember that it is the Friar who gives Juliet the potion to take her own life. By showing the Friar collecting "baleful weeds" (poisonous plants), Shakespeare is hinting to the reader that these "weeds" will have significance later in the play.