First let's look at the text of the Psalm in its entirety:
A Psalm of Asaf.
God stands in the congregation of God; he judges among the judges.
How long will you judge unjustly, and respect the persons of the wicked? (Sela.)
Judge the cause of the poor and fatherless: vindicate the afflicted and needy.
Deliver the poor and destitute: rescue them out of the hand of the wicked.
They know not, nor do they understand; they walk on in darkness: all the foundations of the earth are shaken.
I had said, You are angels, all of you sons of the most High;
Nevertheless, you shall die like a man, and fall as one man, O princes.
Arise, O God, judge the earth: for Thou shalt possess all the nations.
Verse-by-verse walkthrough:
מִזְמ֗וֹר לְאָ֫סָ֥ף אֱֽלֹהִ֗ים נִצָּ֥ב בַּעֲדַת־אֵ֑ל בְּקֶ֖רֶב אֱלֹהִ֣ים יִשְׁפֹּֽט׃
A psalm of Asaph.
God stands in the divine assembly;
among the divine beings He pronounces judgment.
In this verse it uses the same word 'elohim' for the one who stands (prevails) in judgement over the other group of 'elohim'. One way to understand this word is as residents of heaven (as opposed to residents of earth). We understand this singular Elohim who prevails to be Adonay, and those being judged as heavenly creatures.
עַד־מָתַ֥י תִּשְׁפְּטוּ־עָ֑וֶל וּפְנֵ֥י רְ֝שָׁעִ֗ים תִּשְׂאוּ־סֶֽלָה׃
How long will you judge perversely,
showing favor to the wicked? Selah.
Here we have a charge against the heavenly creatures, they have judged wickedly and favoured evildoers.
שִׁפְטוּ־דַ֥ל וְיָת֑וֹם עָנִ֖י וָרָ֣שׁ הַצְדִּֽיקוּ׃ (ד) פַּלְּטוּ־דַ֥ל וְאֶבְי֑וֹן מִיַּ֖ד רְשָׁעִ֣ים הַצִּֽילוּ׃
Judge the wretched and the orphan,
vindicate the lowly and the poor, (4) rescue the wretched and the needy;
save them from the hand of the wicked.
This sounds like their original job description that they failed to do: to take care of people and rescue from evildoers.
לֹ֤א יָדְע֨וּ ׀ וְלֹ֥א יָבִ֗ינוּ בַּחֲשֵׁכָ֥ה יִתְהַלָּ֑כוּ יִ֝מּ֗וֹטוּ כׇּל־מ֥וֹסְדֵי אָֽרֶץ׃
They neither know nor understand,
they go about in darkness;
all the foundations of the earth totter.
Instead they have failed to do their job and the whole earth is shaking from their actions.
אֲֽנִי־אָ֭מַרְתִּי אֱלֹהִ֣ים אַתֶּ֑ם וּבְנֵ֖י עֶלְי֣וֹן כֻּלְּכֶֽם׃ (ז) אָ֭כֵן כְּאָדָ֣ם תְּמוּת֑וּן וּכְאַחַ֖ד הַשָּׂרִ֣ים תִּפֹּֽלוּ׃
I had taken you for divine beings,
sons of the Most High, all of you; (7) but you shall die as men do,
fall like any prince.
The sentence for their failure is death - though they were Sons of Elyon in heaven, they will join humanity in death, united in the same fate as some of those evildoers they helped.
קוּמָ֣ה אֱ֭לֹהִים שׇׁפְטָ֣ה הָאָ֑רֶץ כִּֽי־אַתָּ֥ה תִ֝נְחַ֗ל בְּכׇל־הַגּוֹיִֽם׃
Arise, O God, judge the earth,
for all the nations are Your possession.
Then, after this judgement, the risen Elohim inherits the whole world, and unites all humanity under his rule.
Interpretation (paraphrase):
Adonay prevails in the Council of El,
amidst heavenly creatures He renders judgement.
“Until when will you keep perverting justice
to favor evildoers? Forever?”
“Defend the poor and fatherless,
do justice by the afflicted and needy.”
They either didn't know—or didn't understand,
but stumbled around in darkness
until the foundations of the earth were shaking.
I, God, said “You are all Sons of the Most High,
however you will die like humans,
and fall united with the princes.”
Rise, God, judge the land,
for You will inherit all nations!
Related texts:
and peoples plot vain things; kings of the earth take their stand,
and regents intrigue together
against the LORD and against His anointed? “Let us break the cords of their yoke,
shake off their ropes from us!” He who is enthroned in heaven laughs;
the Lord mocks at them. Then He speaks to them in anger,
terrifying them in His rage, “But I have installed My king
on Zion, My holy mountain!” Let me tell of the decree:
the LORD said to me,
“You are My son,
I have fathered you this day.-b Ask it of Me,
and I will make the nations your domain;
your estate, the limits of the earth. You can smash them with an iron mace,
shatter them like potter’s ware.”
So now, O kings, be prudent;
accept discipline, you rulers of the earth! Serve the LORD in awe;
tremble with fright,-c pay homage in good faith,-d
lest He be angered, and your way be doomed
in the mere flash of His anger.
Happy are all who take refuge in Him.