We tend to be hard on the Pharisees without seeing the difficulty they faced. They were not cartoons. They were men—men who, like us sometimes, learned the right lesson but drew the wrong conclusion from the Law of Moses.
Under the Law, ritual defilement was intended as a kind of sign or shadow: to show us in our pride that we could not, by our own strength and power, keep ourselves clean from sin. The intended lesson: we need God to cleanse us through Christ.
But the Pharisees took away something very different. They concluded they could find sanctity in only one way: separation. Indeed, the word "Pharisee" comes from the Hebrew term meaning "separate". So they separated themselves from Gentiles, from touching the dead and dying, from lepers, and from menstruating women. They were right to see in these ritual prohibitions an image or sign of lifelessness. But they were wrong to conclude that by separating themselves they could avoid the sin which ritual uncleanness signifies. And so in an ironic way, they took the mirror of ritual uncleanness that God has given them in the Mosaic Law, and instead of seeing in it an image of their own uncleanness and defilement by sin, the turned it around and said to those around them, "See how unclean you are!"
The problem came when Jesus brought a higher revelation and a higher law: one that was capable of actually overcoming defilement. It was a classic case of paradigm shift. The Pharisees had invested their entire being in mastering the paradigm they had created in their pride under the Law of Moses. Suddenly, Jesus appeared on the scene saying, "I have not come to abolish the law but to fulfill it" and promulgating a New Law of the Spirit summed up in the Sermon on the Mount (Matthew 5-7).
Matthew very carefully constructs his gospel to make this point clear—in a decidedly premodern way. Bookended with the Infancy and Passion narratives, Matthew consists of five books (just like the Law), each composed of narrative and discourse sections. Jesus propounds the New Law on a mountain, like Moses. And when he comes down from the mountain (in the transition from discourse to narrative beginning in Matthew 8), he encounters one person after another who, under the Old Law, was defiling.
So the first healing miracle recorded by Matthew is performed for a leper. What is notable is the method Jesus chose to heal him. He could have merely said, "Be healed!" (as he showed when he healed the centurion's servant (8:5-13)). But instead, Jesus does something very deliberate and significant: he touches the leper (8:3).
Under the old Law, such an action meant you were ritually defiled and could not go up to the Temple to worship. You had to go through a whole week of purification. Uncleanness, sin, and defilement were more powerful influences than cleanness, sanctity, and purity. In the old Law, sin was the superior power. When someone afflicted with some ritual uncleanness that symbolizes sin touched someone who was clean, the "flow" of power went in one direction only: the clean person was defiled but the unclean person was not sanctified.
But when Jesus touched the leper something astounding happened: the leper became clean and Jesus was not defiled. The flow of power was, for the first time, reversed.
Naturally then, the Pharisees simply do not know what to do with him and are motivated by their pride to misunderstand him. Jesus systematically turns the Pharisaic understanding of the Law on its head. He touches lepers and they are healed (8:14), receives Gentiles and they receive faith (8:5-13), consorts with demon-possessed people in a cemetery and they are restored (8:28-31), permits the touch of a menstruating woman and she's healed (9:18-22), touches the dead and she is raised (9:25), and eats with tax collectors and sinners and makes them saints (9:9-13).
Yet, in all this, the Pharisees see only the ritual defilement, not the revolutionary reversal in the flow of power. For, as Jesus points out elsewhere, pride has blinded them (John 9:35-41). They are so certain they are clean they cannot say with the leper, "Lord, if you're willing, you can make me clean." So they miss the crucial lesson that the time for separation is past. In Israel's childhood, separation from uncleanness and sin was necessary just as it is necessary for us to keep our children from "bad influences" lest they become imitators. But with the dawn of the power of the Kingdom of Heaven, it is the bad influences that are to be conquered with good ones, sin that is to be conquered with virtue, and death that is to be conquered with life.