Which is better, "Bob knows that that is wrong" or "Bob knows that is wrong"? It seems to me that the first "that" is acting as the relation between Bob and the thing that is wrong, while the second "that" is acting as a pronoun taking the place of the thing itself that is wrong. As these are two different functions, I think there should be two that.
Both forms are used in the type of example you quote, for exactly the reason you point out.
However sometimes one of the 'thats' gets dropped. It has not been eliminated grammatically. It is in essence still there but elided.
Much of what we say is routinely elided. If someone asks 'Have you been to Greece?', I might reply 'Yes I went last summer', meaning 'I went there last summer'.