There could be a neurological explanation, philosophical, psychological, and a spiritual one.
Every change in mental state requires a change in brain state, it’s how we function. If our brains are not changing, then neither can our minds. Obviously, when we’re dead, our brains are not changing anymore.
If we accept the philosophy of hylomorphism, which conceptualizes the human being as a composite of matter and form, the two are in
stasis when separated, which happens at death. You are not a complete person and cannot naturally think, remember, imagine, or perceive without your body.
It’s conceivable that some habits or patterns of thinking can become so deeply ingrained that we cannot change them anymore by our own willpower, and in fact, we do not want to change them. As time passes, the pattern only becomes more and more reinforced, and even farther beyond the threshold of our capability to reverse.
Free will is essentially the ability of a soul to choose either for or against God, ultimately. This can manifest earlier or later in life, but it is the wilful act of a person to resist grace, to refuse to cooperate with their Maker, and this is not considered in time, but as a total sum of that soul’s existence (
eternal sin). This is why even after the General Resurrection that decision is confirmed by them as an act truly imputed to them, and not imposed on them.