This is likely a proverb that the writer has used to describe either the king or the nation of Israel. That which others have considered worthless, Yahweh has made to be the most important. (See: [[rc://en/ta/man/translate/writing-proverbs]])
Possible meanings are 1) "it is a marvelous thing for us to see" or 2) "we consider it to be a marvelous thing." (See: [[rc://en/ta/man/translate/figs-idiom]])