If we carefully consider the doublets of Chapter 25, we see that the immediate context (vv. 1-20) contains themes of judgment, court, and arbitration, all under the authority of a king.
1) It is the glory of God to conceal a matter; to search out a matter is the glory of kings.
The final doublet of the chapter should stick out because it directly refers to two doublets that occur earlier in the chapter. This makes it unique among the chapter and directs attention back to these. They are:
Proverbs 26:2-3 It is the glory of God to conceal a matter; to search out a matter is the glory of kings. As the heavens are high and the earth is deep, so the hearts of kings are unsearchable.
Proverbs26:16-17 If you find honey, eat just enough— too much of it, and you will vomit. Seldom set foot in your neighbor’s house— too much of you, and they will hate you.
The final doublet is:
It is not good to eat too much honey, nor is it honorable to search out matters that are too deep. Like a city whose walls are broken through is a person who lacks self-control.
Because of the context, it should be clear that the verse in question is not in reference to science, which simply didn't exist at the time. The "wise men" of that day were not scientists, but alchemists. They investigated matter and spirit in a significantly different manner than science, though it was from their methods that science developed. Indeed, some philosophers of science find little difference between the two yet.
The verse discusses not scientific matters but matters under arbitration by a king. That's why it is the glory of the king to search them out. When arbitrating, it brings the king honor if he searches out the matter to discover what actually happened so that he can judge rightly. Recall the famous story of Solomon's judgment at court.
1 Kings 3:16 And all Israel heard of the judgment which the king had rendered; and they feared the king, for they saw that the wisdom of God was in him to administer justice.
The verse in question contrasts the glory of God and that of kings. Kings seek matters out, and God conceals them... for a time. Recall the story of Nebuchadnezzar's dream in Daniel 2. When God reveals the dream and its meaning to Daniel, he gives thanks to God not as a concealer, but a revealer:
Daniel 2:19-23 During the night the mystery was revealed to Daniel in a vision. Then Daniel praised the God of heaven and said:
“Praise be to the name of God for ever and ever;
wisdom and power are his.
He changes times and seasons;
he deposes kings and raises up others.
He gives wisdom to the wise
and knowledge to the discerning.
He reveals deep and hidden things;
he knows what lies in darkness,
and light dwells with him.
I thank and praise you, God of my ancestors:
You have given me wisdom and power,
you have made known to me what we asked of you,
you have made known to us the dream of the king.”
So God indeed conceals the matter from the king but reveals it to his servant. That is, it is the glory of God to conceal some matters from some and reveal them to others in order to demonstrate his power. Indeed, by concealing the matter from Nebuchadnezzar and revealing it to Daniel, the King of the world fell prostrate before a servant and exclaimed:
Daniel 2:47 47 The king said to Daniel, “Surely your God is the God of gods and the Lord of kings and a revealer of mysteries, for you were able to reveal this mystery.”
And so, it is the Glory of God to conceal a thing, and the glory of Kings to search them out.
2) As the heavens are high and the earth is deep, so the hearts of kings are unsearchable.
Proverbs 26:2 sets the ways of kings against the ways of God, the one searching out and the other concealing. This contrast in context demonstrates the greatness of God, who is able to conceal a thing from a king as he did from Nebuchadnezzar. Despite the king's ultimatum, none of the wise men could reveal the vision that God had put in the heart of the king. It begs the question: If the heart of a king is unsearchable, how much more unsearchable is that of God?
Romans 11:33 Oh, the depth of the riches both of the wisdom and knowledge of God! How unsearchable are His judgments and unfathomable His ways!
Isaiah 40:28 Have you not known? Have you not heard? The LORD is the everlasting God, the Creator of the ends of the earth. He does not faint or grow weary; his understanding is unsearchable.
It is not good to eat too much honey, nor is it honorable to search out matters that are too deep. The heart of God is unsearchable, and so should we not search it out? It is not honorable to seek out a thing that is too deep, and it is not honorable to search out the heart of God. That is, the one who works to seek it out is (has been) dishonored. This is the failure of the wise men of Israel.
Psalm 118:20-23 This is the gate of the Lord
through which the righteous may enter.
I will give you thanks, for you answered me;
you have become my salvation.
The stone the builders rejected
has become the cornerstone;
the Lord has done this,
and it is marvelous in our eyes.
Like the wise men in Nebuchadnezzar's court, they were dishonored when God revealed the truth of the matter.
Jeremiah 2:26-27 "As the thief is shamed when he is discovered, So the house of Israel is shamed; They, their kings, their princes And their priests and their prophets, Who say to a tree, 'You are my father,' And to a stone, 'You gave me birth.' For they have turned their back to Me, And not their face;
Colossians 2:15 And having disarmed the powers and authorities, he made a public spectacle of them, triumphing over them by the cross.
1 Corinthians 2:22-24 For indeed Jews ask for signs and Greeks search for wisdom; but we preach Christ crucified, to Jews a stumbling block and to Gentiles foolishness, but to those who are the called, both Jews and Greeks, Christ the power of God and the wisdom of God.
In the context of judgment and arbitration by a king, extending the analogy as before implies that the manner by which God judges is unsearchable. We can not search out the heart of God for ourselves. But we can know it, in Messiah. Knowledge of the heart of God does not come by our effort (or deduction), but only comes by the Spirit of God.
We do, however, speak a message of wisdom among the mature, but not the wisdom of this age or of the rulers of this age, who are coming to nothing. No, we declare God’s wisdom, a mystery that has been hidden and that God destined for our glory before time began. None of the rulers of this age understood it, for if they had, they would not have crucified the Lord of glory. However, as it is written:
“What no eye has seen,
what no ear has heard,
and what no human mind has conceived”—
the things God has prepared for those who love him—
these are the things God has revealed to us by his Spirit.
The Spirit searches all things, even the deep things of God. For who knows a person’s thoughts except their own spirit within them? In the same way no one knows the thoughts of God except the Spirit of God. What we have received is not the spirit of the world, but the Spirit who is from God, so that we may understand what God has freely given us. This is what we speak, not in words taught us by human wisdom but in words taught by the Spirit, explaining spiritual realities with Spirit-taught words. The person without the Spirit does not accept the things that come from the Spirit of God but considers them foolishness, and cannot understand them because they are discerned only through the Spirit. The person with the Spirit makes judgments about all things, but such a person is not subject to merely human judgments, for,
“Who has known the mind of the Lord so as to instruct him?”
But we have the mind of Christ.