Why not just say, "He wanted to make sure the window was closed."?
To reword the OP, "All my good faith had no effect on the outcome."
To reword the title, "I hate when that happens."
Agreed, almost every time this happens, I think someone's just being lazy or intentional. As a matter of personal preference, I reword sentences to exclude the word "that" altogether whenever possible, so the idea of two consecutive "that"s being unavoidable severly strains my credulity.