If I could re-translate it into a paraphrase, it would be a lot easier to understand. In other words, the fool, upon seeing wisdom is out-matched, knows he has no chance to gain respect, and tries to hide. The fool is not an idiot. The fool is rather an absurd person. The fool is not someone who is incapable of thinking, but rather one who calculates and reasons wrongly.
Foolishness respects the actions of a thinking person.
This is the sense of fool meant here in this verse. In the book of Proverbs we often see the fool being shown as one who lacks understanding. When, in the book of Proverbs, this is seen, it is usually that the fool is trying to impose his will where he has no place being. In these cases, fool might be better understood as folly, silliness or even emptiness. This type of fool is not in mind in this verse.