The Zohar: At the hour when the world was overfilled with the sins of humans and was brought to trial, woe to the righteous who live in that world, for they are the first to answer for the sins of the wicked.
So how was Noah able to escape the flood and not be punished for the sins of his generation? The Creator wanted him to beget the posterity of the world, and that is why He saved him.
There are many wicked people (egoistic desires) in the world (inside man), but they weren’t able to take advantage of Noah’s good desire (the one spiritual desire, the point in the heart). That is why the wicked (bad desires) were cut off from Noah (the correct desire) by the flood and drowned. (These desires died within a person, so he stopped feeling them. For the time being this constitutes his correction, but later on, when he corrects these desires, they will reappear).
Man’s one tiny, correct desire for bestowal, called Noah, was saved by the Creator (by Ohr Makif – the Surrounding Light), taking shelter in the “ark.” (One is granted an additional force, a protective shell made of the quality of bestowal, called ark, a mother’s womb or Bina).
And the court had no power over him, for he had taken shelter in the ark, hidden from all eyes. The court held trial over the egoistic desires, but it had no power over the desire to bestow. This is talking about a person who has acquired a connection of bestowal with the group, took shelter in it, and thus hid from the evil eye, from his egoistic desires that wanted to draw him away from the goal.
It is written: ask for absolution, ask for mercy, and perhaps you shall escape the Creator’s wrath. One cannot escape the Light’s influence. The Light shines and divides one’s desires into those that have the Light in their qualities and those that are against it.
Noah asked for absolution (correction from Above), entered the ark and hid there (in the Creator’s quality of bestowal; he dissolved in it like a drop of semen in a mother’s womb), on the day of the Creator’s wrath (the revelation of the Light of Hochma, which separates desires according to their intention – to receive or bestow). That is why the court had no power to accuse him.
He hid inside the quality of bestowal of the Upper One, the Creator. Malchut ascends to Bina and hides there; that’s what it means to be righteous, Hassadim – to ascend above one’s egoism.