Mercutio utters this line three times after having been run through by Tybalt in a street duel. He fought the hot-headed Capulet, who is Juliet's cousin, after Romeo, having just married Juliet (unbeknownst to everyone involved) refused to. Essentially, the phrase is a curse, wishing ill will on the "houses," or families whose feud he claims resulted in his death:
A plague o’ both your houses!
They have made worms’ meat of me. I have it,
And soundly too. Your houses!
There is a sense in which the families are, indeed, cursed. The Prologue refers to Romeo and Juliet as "star-cross'd lovers" that are essentially victims of fate. Certainly the events that take place after Romeo retaliates for his friend's death by killing Tybalt have an air of cosmic inevitability about them.