I wasn't sure the best way to blog about this Psalm. I've started over several times. Then I realized that a good way to see the meaning of Psalm 14 is to read Romans 3. They parallel each other in many ways.
People who don't believe in God or say that they don't need God are foolish. They think "I'm not a bad person." They need to listen to the words of David "There is no one who does good, not even one." (Ps 14:3)
Paul quotes this Psalm (or perhaps another one that says the same thing) to show that everyone - Jews and Greeks - are all sinners.
Romans 3:23 for all have sinned and fall short of the glory of God
The Psalm says that God is with the righteous.
Romans 3 says it this way:
24 being justified as a gift by His grace through the redemption which is in Christ Jesus ; 25 whom God displayed publicly as a propitiation in His blood through faith. This was to demonstrate His righteousness, because in the forbearance of God He passed over the sins previously committed ; 26 for the demonstration, I say, of His righteousness at the present time, so that He would be just and the justifier of the one who has faith in Jesus.
That's the long version of saying that those who have faith in Jesus are justified (made righteous) because of their faith.
The Psalmist knew that God was with the righteous. Paul explains that God demonstrates HIS righteousness (and passes over the sins) of those who have faith in Jesus.
This is a fantastic truth! The fool will continue to say, "There is no God." Fools who have power in other parts of the world persecute those who have faith in Jesus. Fools in the USA harass and make fun of Christians (Tim Tebow is a prominent example.) But God is with the righteous and is their refuge. Ps 3:5-6.