The reason why God forbid pork is because of the dietary laws, also known as kashrut for Israelites, which marks them as holy and distinct, with pigs being deemed as unclean for not chewing the cud, despite them having split hooves.
This symbolized separation from pagan practices, with potential health and cultural reasons, like pigs being scavengers and associated diseases.
Although the primary purpose of God forbidding pork was for spiritual identity and a restriction that was later reinterpreted or lifted by many Christians.
God basically forbid pork due to biblical and spiritual reasons, such as for Judaism and Christianity, health and cultural theories, and Christianity and the new testament.
For Holiness & Distinction: The laws, including the pork prohibition, set Israelites apart as God's special people, distinct from surrounding nations who ate pork.
For symbolism of Uncleanness: Pigs were considered impure because they had cloven hooves but didn't chew the cud, failing the "clean" criteria in Leviticus 11:7 and Deuteronomy 14:8.
For obedience: The primary reason was to teach obedience and demonstrate holiness through adherence to God's commands, even in dietary choices.
For Pagan Practices: Avoiding pork also helped Israelites avoid participating in rituals of neighboring cultures where pork was consumed.
For disease: Pigs were often associated with scavenging and filth, potentially carrying diseases like trichinosis, making them a health risk in ancient times.
For competition: Pigs compete with humans for food (grains/scraps) and are harder to raise in arid, desert environments where sheep and goats thrived.
And for Jesus & Peter: Jesus indicated that what defiles a person comes from within, not from food, and Peter's vision in Acts 10 proclaimed all foods clean.
And for the New Covenant: Many Christians believe the New Covenant ended these ritualistic dietary laws, though some denominations still follow them.