What verse in the Bible talks about bad people preaching the gospel being a good thing? Some time ago I read this verse about greedy people who announce the gospel because of their own greed, which is a bad thing, but it ends up that this is a good thing because more people will hear about Jesus. 

I can't tell if the verse says exactly this, but I'm pretty sure that is something very likely. Can someone help me?
From what you've said, i can almost certainly say this is Philippians 1:18


  But what does it matter? The important thing is that in every way, whether from false motives or true, Christ is preached. And because of this I rejoice. Yes, and I will continue to rejoice (Philippians 1:18 NVI)


This passage's context is pretty much like what you've read: bad people preaching isn't bad at all, God can use them to reach a good purpose.

But it is not about greedy people, you read in verse 15 that he is talking about people who preach out of "envy and rivalry". But the essence is quite the same.