We have seen many authors approach the impurity vs purity issue that was adressed through Leviticus. One point of view is that everything really comes back to the idea of death against life and so this constant struggle is manifested through the idea of purity. Another idea is that, it is a representative of what leads to a good life. If we boil it down, most of those rules of representations of purity cover major social and health issues that we run through everyday. If we objectively look at one of the functions of religion, there is a clear idea that it tries to show the best way of life for its followers. These rules could have been coded in the form of purity and impurity to hide that they genuinely serve the common good. For example, the idea that if you get a skin disease, you become impure. There are multiple skin diseases that are contageous and so this could be a way to control these issues (especially in times where it was hygene was critical).
God wants these purities because he wants what is best for human beings. If God is the representation of all goodness and holiness in the world, and we know that all the impurities are not bad but deviate from the ultimate goodness then it seems obvious that these two concepts can’t mix. How does something come impure in the first place? It is by something pure coming in contact with the impure and getting infected by it. I am not suggesting that God can get inefected with these impuritites, but rather trying to look at this idea through the archetypes and the purposes hidden beneath the words.
I think the same thing applies to eating. I have no idea if pig meat is bad for you or not but I would say that in general not knowing how to cook something or eating it in wrong way could potentially lead to severe health related epidemics. Moreover, we could also look at this in maintainting the general fittness of the human being as a whole, because pig meat has way more fat than other forms of meat. This might seem stupid, but that is the only rational I can come up for it.