The Ascent of Mount Carmel continues. We learn about the relationship between the three theological virtues (faith, hope, and love/charity) and the three faculties of the soul (understanding, memory, and will).
BTW, it would be a mistake to think that St. John of the Cross is claiming as a scientific fact that cerebral memory resides in the soul. We are talking about real memory — how the soul knows itself, and that sort of thing. Obviously, the theology of the body view would be that neurological processes and the soul are intimately intertwined and were made to work together, but that ultimately the soul can remember when the body cannot (due to damage or death). Same thing with understanding and the will. Equally obviously, this is something that can be reasoned about but not scientifically tested. (AFAIK.)
However, it’s true that “sin makes you stupid” because it clouds your understanding and narrows your view, and certainly the sins on your soul weaken your will and make it harder to resist further sin. The same narrowing is likely true of memory; we call things to mind based on our character, and attitudes of the moment; and we tend to forget what’s inconvenient to remember.