The judging and on the mote and beam all exemplify the same concept, that we are judged of God according to the way we judge others. All of those verses hang together on the basis of that underlying theme. There is no such connection in this verse with those that went before, nor is this saying connected to the one that follows. This verse stands by itself, and its meaning is internal, and unrelated to the context of the verses either prior or subsequent.
There is a structural parallel to the formation of the judging statement. There is a single statement supported by two examples. However, the order of examples and statement differ from the judgment saying.
In this case, we have two descriptions of an action of giving something to an animal. This is stressed as undesirable in that both actions could result in the animal ignoring what was given and acting like an animal and turning on us. What is being given, and why the caution against the animal turning on us?
Two things are given: “that which is holy,” and pearls. Pearls we understand. “That which is holy” is a reference to the food offered to God on altars. In both cases something that has value is being given to an animal. The two types of offerings to animals escalate from plausible but wrong to completely ridiculous. The movement is intentional.
In the first case, we have food being given to a dog. This happens all of the time. There is nothing unusual about giving meat to a dog. The problem is that this isn’t just any meat, but meat that has been consecrated to God. This example, therefore, is plausible in that it is meat given to a dog, and we certainly might think that a dog would want the meat. However, it is not just any meat, but holy meat, and therefore should not be given to a dog, as it is consecrated to God.
In the second example, we have pearls being given to swine. This example is intended to be completely ridiculous. First we have pearls which are valuable to us, but of no worth at all to an animal. Secondly, the particular animal selected is unclean swine. Giving anything of value to the unclean swine would immediately make that thing unclean, and therefore unworthy of a righteous man (although it could be made clean again – but that is not the issue in this example).
Thus the movement of the example is from plausible but wrong to obviously ridiculous. The clear admonition is that these things of value should not be given to animals. Obviously, however, the saying has nothing to do with giving things to animals. Rather, it has to do with sharing things of value with other people who may or may not act towards them as the animals are acting in this example.
What these people had to give was neither meat from the altars (to which they had no access) nor pearls (to which they probably had even less access). What they did have was the gospel that was both sacred, and comparable to a pearl (note the parable of the pearl of great price in Matthew 13:45-46). They had a gospel to give, but were to be cautious about to whom it was given. This was pragmatic information, for clearly there were those “dogs” and “swine” who should have been their brothers, who should have accepted the gift, but instead turned on the early Christians and persecuted them. Saul (later Paul) was one of these who early rejected not only the gift of the gospel, but actively turned on and “trampled” the early Christians prior to his own miraculous conversion. Thus this saying is a pragmatic one directed as the way in which the listeners should share the gospel that they had learned and accepted.
Book of Mormon Context: The gathered saints in Bountiful were no longer in a situation where they had to be cautious about sharing the gospel with anyone in the community. The dramatic appearance of the expected Atoning Messiah had rather altered the religious landscape for any who saw the Messiah and heard him. Nevertheless, as with other sayings, these words would have resonated with past experience. Perhaps they served as a caution against sharing the gospel too widely, into other communities that had not had the Nephite religious background, and particularly who had not been witness to the arrival of the Lord.
In the New World the vocabulary of the saying would have had to have changed, even if the meaning were precisely the same. There is no evidence of any pearl trade in Mesoamerica, and certainly no swine. There were dogs and offerings on the altar to God, so that part of the saying would be relevant, but the pearls/swine saying would have had to have been modified to fit a more culturally appropriate example.
Textual: There are no changes from the Matthean text.