The issue here is that the syntax of the core 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."
In this case, a verb and its complements (the core of a sentence) are considered to be too intimately connected to be separated by a comma even if one is part of a quotation. The same applies to other intimate links between words, such as that between article and noun, between adjective and noun, etc.