Understanding What It Means Not to Cast Your Pearls Before Pigs

One of the most confusing yet not impossible to understand passages is all about casting pearls before swine in Matthew 7:6. Pigs were not raised in Israel and they are still illegal to this very day. If you read through Leviticus 11 - you will realize that pigs are also among the unclean meat. That means no pork-related dishes are allowed within the Old Testament. Also, we do read in Matthew 8:28-34 that Jesus cast the demons into the pigs which caused them to drown. The pork was only and finally allowed for consumption in Peter's vision in Acts 10:9-16. So how can the figure of speech be properly interpreted?

Here's an interesting take from Got Questions which talks about what it means not to cast pearls before swine:
Before Jesus says, “Do not cast your pearls before swine,” He says, “Do not give dogs what is sacred.” An analogy mentioning dogs is also used in Proverbs: “As a dog returns to its vomit, so a fool repeats his folly” (Proverbs 26:11). A dual reference to swine and dogs is also found in 2 Peter 2:22, “Of [false teachers] the proverbs are true: ‘A dog returns to its vomit,’ and, ‘A sow that is washed goes back to her wallowing in the mud.’” In His sermon, Jesus uses dogs and pigs as representative of those who would ridicule, reject, and blaspheme the gospel once it is presented to them. We are not to expose the gospel of Jesus Christ to those who have no other purpose than to trample it and return to their own evil ways. Repeatedly sharing the gospel with someone who continually scoffs and ridicules Christ is like casting pearls before swine. We can identify such people through discernment, which is given in some measure to all Christians (1 Corinthians 2:15–16). 
The command not to cast your pearls before swine does not mean we refrain from preaching the gospel. Jesus Himself ate with and taught sinners and tax collectors (Matthew 9:10). In essence, the instruction in Matthew 7:6 is the same that Jesus gave to His apostles when He said, “If anyone will not welcome you or listen to your words, shake the dust off your feet when you leave that home or town” (Matthew 10:14). We are to share the gospel, but, when it becomes apparent that the gospel is not welcome, we are to move on. We are responsible to share the good news; we are not responsible for people’s response to the good news. Pigs don’t appreciate pearls, and some people don’t appreciate what Christ has done for them. Our job is not to force conversions or cram the gospel down people’s throats; there’s no sense in preaching the value of pearls to swine. Jesus’ instruction to His apostles on how to handle rejection was to simply go elsewhere. There are other people who need to hear the gospel, and they are ready to hear it.

A possible interpretation is that all you can do is warn others. You can't change their minds about the Gospel no matter how good you behave and how good you explain. It's a call to be discerning that if the person has been warned then there's nothing you can do. Any good doctor knows that all he or she can do is warn the patient about the sickness. If the patient refuses to cooperate then any good doctor must respect that decision. It's not allowable within the medical code of conduct to treat uncooperative patients. Can you imagine performing a dangerous surgery on a patient who is not willing to cooperate? It could end up with the doctor killing the patient or the patient killing the doctor before the surgery can even take place. If you do insist on preaching to hardheaded people then you might as well prepare to get mauled by them as a result of it.

Yet, another interpretation that some have about casting pearls before swine would be this. Some may suggest that it means that it means not walking the talk. How can anyone have the credibility to talk about the Gospel if your life isn't showing it? 2 Timothy 3:5-7 also warns that it's possible to have some kind of "godliness" yet the lifestyle isn't showing it. Romans 2:21-22 says that you must practice what you preach. Jesus also warned in Matthew 23:3 warns about the Pharisees in their attitude that says and do not practice what they preach. How can you have the credibility to talk about God if you don't display a godly behavior towards others?