ISRAEL WAS commanded to be holy because God was literally in their midst. The Law set them apart for Yahweh, distinct from other people.
We note that some foods declared unclean, especially pigs, may have been so designated because of their use in pagan rituals (in the case of pigs, as offerings to the dead). However, the bottom line is that God established very specific rituals for washing and sacrificing to maintain holiness—a Law that only changed upon Christ’s ascension to sit at the right hand of God (see Hebrews chapters 7 through 10).