The messenger of Christ exercises discernment.
Jesus was well aware that not everyone would be receptive to the message of salvation that the apostles would be proclaiming.And so he tells them that when they come across those who refused them and their message, they should respond by leaving the town, shaking the dust off their feet as they go.