But categories help us understand ourselves, and simplifying so as to speak only of the wicked and the righteous allows us a stark and clear perspective on options. Probably you are also raising a second question, a question more substantial and difficult than the first. You may ask whether the Psalm is true, whether God does indeed maintain a morally coherent universe such as it describes. Human experience seems to confirm the opposite. Often the wicked appear to be the happy or fortunate ones.
Crime does pay.
Dishonesty has proven to be a good policy for many. And those who earnestly seek to live a God-directed life often do not prosper. The psalmist appears to be very naive, or overly optimistic. However, it's hardly possible that the psalmist was naive. Many of the psalms that follow raise exactly the same questions about the way things are, asking what's the use in being good.