Dear Mr. B:
You wrote:
In one of my essays at school, I wrote “… and I doubt that was the idea”. This was then changed by my teacher to “… and I doubt that that was the idea”. I thought the second “that” wasn’t required, but I’m unsure. Can you help?
Your grammar is correct. In modern English, the relative conjunction “that” is often dropped.
He said that he was a cowboy.
He said he was a cowboy.
It can be dropped in the example you gave as well.
Having said that, your teacher is correcting your style, not your grammar. While your sentence is grammatically correct, it can be confusing to the reader because the remaining “that” is the subject of the clause, a demonstrative pronoun, but it might be read as the relative pronoun and would cause the reader to stumble. Especially in formal writing, or writing that you want to make clear, it is better to include both the relative and demonstrative pronouns.