A little religious/cultural context here: the priests and the levites had duties at the Temple in Jerusalem that they would have been ineligible to perform if they had been in contact with a corpse. Not that I endorse the choice to exercise prudence about ritual purity when a stranger is lying dead or dying in the road, but that's the subtext.