Most people in ancient Judea saw the world differently than we do. To them—and in particular, to the priests—the temple and the continuing worship that took place there ensured God’s presence in the temple and God’s blessing of the land with protection and good conditions for farming. It was the priests’ duty to carry out the temple service correctly to maintain this abundance and security. To achieve this purpose, priests had to fulfill strict purity regulations; otherwise, their worship might not “count” and the divine blessings might not come.
Priests occupied an important and mostly well-regarded position in ancient Jewish society: they were trained not only in religious matters but also in Jewish law, literature, and tradition. Criticism against the high priest and the leaders of the priesthood may have been fairly common, but that should not lead us to think that priests in general were not well regarded. The fact that priests identified as priests long after the second temple was destroyed (70 C.E.) shows that descendants of priests were proud to be priests even when a different group, the rabbis, had taken control of what was to become rabbinic Judaism.
Levites were similar to priests in that they were a patrilineal, hereditary order and they worked in the temple. Their purity was important, too, but the rules regulating them were not as strict. Levites were not regarded as highly as priests for most of the Second Temple period (539 B.C.E.–70 C.E.); they are often described as a lower-level priesthood. They manned the temple gates, cleaned the temple, slaughtered some of the sacrificial animals, and performed the music during temple worship (1Chr 23-25).
In order to become a priest, one had to be the son of a priest and be pure in mind and body. (And according to the Pentateuch, priests were also said to be from the tribe of Levi.) It is likely, based on both biblical and Mesopotamian texts on priesthood, that every time a priest came to the temple to carry out his service there, his purity would have been tested by a group of priests and Levites who would probably have physically examined him (for skin diseases or broken bones) and made sure that there were no allegations of misconduct.
In the parable of the Good Samaritan (Luke 10:29-37), a priest and a Levite pass by a badly injured person. Why might they have done this? The priest did so because Num 19 states that he must avoid corpse impurity. Touching a dead or dying body, even holding a hand over it, would render the priest ritually impure and put his temple service at risk. It is less clear why the Levite avoids the wounded man, as the Levite is not commanded to avoid corpse impurity in the same exclusive way.
For a modern analogy, imagine a scientist who runs a nuclear power station. He or she must ensure that employees follow strict rules to prevent radiation contamination and to ensure the safety of the entire community. In the same way, priests and Levites had to be careful about whether they brought something impure into the temple (or took something holy out of the temple; see Ezek 42:13-14), so as not to put the well-being of their community at risk.