The issue here is that the syntax of the sentence he couldn't... transcends the quotation boundary. The subject, he, is not part of the quotation, but its verb, couldn't, is. In that case, you would not use a comma, unless you already needed a comma in regular syntax, i.e. if there were no quotation. But that is not the case here. So this is the correct version:
The author writes, and I'm quoting his words exactly, that he “couldn't understand why it happened."