If I were to arrive at a conclusion to your question concerning Psalm 14:5 using Biblical Theology only I’d say it means that Elohim is righteous in every age.
Here is my drawn out reasonings
Righteousness belongs to Elohim and is imputed by faith. Whenever a person is called righteous it must be assumed that it is imputed righteousness and that it is as a result of faith which is demonstrated in works through obedience in any age and any dispensation.
“There was a man in the land of ‘Utz whose name was Iyov. This man was blameless and upright; he feared God and shunned evil.”
Iyov (Job) 1:1 CJB
This exact phrase is repeated in the divine council by Elohim Himself in v8. However it’s important to note that Job is not described with the usual Hebrew word for righteous but rather upright and blameless.
“So these three men stopped trying to answer Iyov, because he remained convinced of his own righteousness.”
Iyov (Job) 32:1 CJB
Job’s problem was he took his upright and blameless living which was facilitated by Elohim Himself and ascribed it to himself. While Elohim does not deny Job’s upright and blameless living He stands against pride and pride I understand to be defined as, any time that you rely on your own strength, your own wisdom and/or your own righteousness.
What was wrong with Job’s self righteousness was that it denounced Elohim and practically placed a sticker on top of His righteousness with Job’s name on it.
“I hold to my righteousness; I won’t let it go; my heart will not shame me as long as I live.”
Iyov (Job) 27:6 CJB
It’s unfortunate that Job confuses the act of obedience and faith with the righteousness of Elohim and ascribed his living to himself. Elihu saw this fallacious oversight and that the consequence of such reasoning is to make Elohim out to be unjust. After all at one point Job says what good is it that I lived a righteous life, if suffering is all I can show for it while the unrighteous know no suffering
“But then the anger of Elihu the son of Barakh’el the Buzi, from the family of Ram, blazed up against Iyov for thinking he was right and Elohim wrong.”
Iyov (Job) 32:2 CJB
Elihu goes on to say how righteousness ought to be viewed
“I may search far and wide for my arguments, but I will ascribe righteousness to Elohim my maker.”
Iyov (Job) 36:3 CJB
The Bible clearly says that pride is punished
“Everyone who is proud in heart is an abomination to the LORD; Assuredly, he will not be unpunished.”
Proverbs 16:5 NASB
Elohim resists the proud and Job due to his self righteousness qualified as prideful
Then Job finally recognizes his error, peels the sticker label with his name on it, off of Elohim’s righteousness and repents
Noah on the other hand is called righteous but it cannot be because of his own righteousness but rather his faith in Elohim which is demonstrated in obedience. Faith without works is dead, or put differently you can’t look for an effect without a cause, Faith is the cause of the works.
“Here is the history of Noach. In his generation, Noach was a man righteous and wholehearted; Noach walked with Elohim.”
B'resheet (Gen) 6:9 CJB
Walking with Elohim was a demonstration that Noah had faith/trust in Elohim and this was why he was reckoned righteous.
The same Hebrew word for generation used here is used in Psalm 14.
You can read it as generation but I prefer to read it as AGE (or PEOPLE within an age). In Noah’s case it was the age prior to the flood. The Psalmist age would be the age when Israel was juxtaposed against all the other nations. There is also the generation or age of the Church
“But you are a chosen (generation), the King’s cohanim, a holy nation, a people for Elohim to possess! Why? In order for you to declare the praises of the One who called you out of darkness into his wonderful light.”
1 Kefa (1 Pe) 2:9 CJB
It goes back to this very verse that I think says it all
“But seek first his Kingdom and HIS RIGHTEOUSNESS, and all these things will be given to you as well.”
Mattityahu (Mat) 6:33 CJB
It’s His and if He calls us righteous like He did Abraham it was because of faith and it was imputed.