Problem: Solomon writes, “Do not be excessively righteous and do not be overly wise. Why should you ruin yourself?” (Eccl. 7:16) This is given in contrast to being “excessively wicked” (v.17). Should believers not strive for personal righteousness?
Solution: Believers should strive to love God and others with their whole lives (Mt. 22:37). However, we should abstain from self-righteousness. Remember, in this section of Ecclesiastes is meant to focus on the human perspective—apart from God—not God’s perspective of humans. Thus Solomon is criticizing a human view of their own righteousness—not their actual righteousness.
A parallel account is helpful here. Solomon explains elsewhere, “Do not be wise in your own eyes; fear the Lord and turn away from evil” (Prov. 3:7). Here Solomon critiques false wisdom and self-righteousness. This would fit with the wisdom of the world that Paul also criticizes (1 Cor. 1:18-25). This makes sense of the following verses in Ecclesiastes, where Solomon writes, “It is good to grasp the one and not let go of the other. The man who fears God will avoid all extremes” (Eccl. 7:18 NIV). In other words, Solomon is telling us not to listen to the self-righteous or the openly rebellious, but to “avoid all extremes.”
Solomon is not telling us to be wicked or evil. The very next verse tells us that this will shorten our lives (Eccl. 7:17). The contrast to wickedness or self-righteousness is to “fear God” (Eccl. 7:18).