There is a moment when a person sees clearly what unconscious action has cost, and something in them breaks open. David, having numbered his people in the pride of the mind, suddenly wakes to the folly of it. This is not the ego's guilt, which only recycles the past and calls it remorse. It is the deeper recognition that the whole thing was done in sleep.
To call it foolishness rather than merely wrong is honest, for unconsciousness is the root of all harm. And to ask that the iniquity be done away is to let it go completely, not to carry it as a story of self-punishment. When you see that you acted from unawareness, the seeing begins to free you, because you are no longer the one who did it but the one now awake to it.