If your dryhopped batches were ruined, it was NOT from the dryhopping. You add the hops, not boiled, into the beer. That's it.
Adding a bag or something may contaminate the batch, but I assume the bag would have been sanitized.
Next time, add the hops. Just hops, right from the bag you bought them in. That will make sure nothing else touches the beer, and the hops aren't boiled, or added to water or sanatizer or anything.