Like a muddied spring or a polluted fountain
is a righteous man who gives way before the wicked.
It takes just a little sin to defile what is holy, like a little mud can foul a clear stream. This is why Solomon warns us (particularly leaders in this context) about our closest associations. Sinful associations that allow wicked actions to go unchallenged will result in some serious pollution. A righteous person must stand in their righteousness and not let evil or tolerance of sin creep in.
The image I see here is that righteous people (God's redeemed people) can be clear, refreshing streams through which God's redemptive message and work will flow. But should we knowingly accomodate evil (in practice or in false doctrine), we fail to obey and glorify God and though His truth might flow, it is mixed with the mud of sin and the resulting pollution may make it no longer effective.
I should live in this world. I should befriend non-Christians, for Jesus is the friend of sinners. But I cannot "give way before" what I know is wicked. I must have my strong beliefs. I want the gospel's clear stream to flow through and around me so that others may know the joy and beauty of the sparkling clear water!