"Do not eat the bread of a selfish man or desire his delicacies"
This is an unfortunate translation of this proverb. It makes it sound like you are to avoid the foolish person for it is the foolish person who is selfish, but the word selfish is really the Hebrew word ra which is the word for evil or wicked. God is trying to tell us who to avoid and have no fellowship with. It is the person who has moved outside of God's moral boundary structure and is content to live outside of God's Ten Commandments. They practice false religion or magic; they swear constantly; they do not worship God with any of their time; they do not honor authorities; they murder; they commit adultery; they steal; they lie; they covet other people's goods.
Now there are two possible directions that this proverb can go. God can be telling us to never eat anything with this person. Or he could be telling us to not begin a relationship with this kind of person in which we will become aware of what this person has gained from their wickedness.
It would seem best to understand this proverb as prohibiting the relationship rather than the single meal. The New Testament follows up with this idea in 1 Corinthians 5 where it says do not have a relationship with a so-called brother if he is involved with sorcery, idolatry, adultery, swindling, etc. It is the on-going relationship which must be cut off. Eating a meal with a person was a way of denoting a relationship.
The message is the same as 1 Corinthians 15:33 -- Do not be deceived: bad company corrupts good morals. The company you keep will determine your actions. I realize that everyone says that they will never do what these friends of theirs do, but there is subtle or overt pressure constantly to push past your boundary lines. The only exception to this rule is in order to evangelize them. The Apostle Paul says not to avoid non-Christians but those who are so-called Christians who behave like this.
The point of the proverb is clear. Do not develop on-going relationships with those who are wicked and live outside the boundaries of the Ten Commandments. If this kind of person is your close friend, then there will be pressure to move in their direction. If this kind of person is interested in the gospel, then share the gospel but do not desire their lifestyle.
We do not hear this message of "come out of them and be separate" very much anymore. It has caused many Christians to compromise with the world.