Leviticus 17:15 NIV
Anyone, whether native-born or alien, who eats anything found dead or torn by wild animals must wash his clothes and bathe with water, and he will be ceremonially unclean till evening; then he will be clean.
Deuteronomy 14:21 NIV
Do not eat anything you find already dead. You may give it to an alien living in any of your towns, and he may eat it, or you may sell it to a foreigner. But you are a people holy to the LORD your God. Do not cook a young goat in its mother's milk.
Earlier on in the book of Leviticus Moses had told the people that anyone Israelite or Alien who ate an animal that he found dead became ceremonially unclean,but in the book of Deuteronomy he actually tells the Israelites to give it to the aliens to eat.
How to understand the above texts?