Here is a link to a blog that pretty much covers this question in Egypt, Rome etc in antiquity:-
https://blog.longreads.com/2015/10/14/i-would-rather-be-herods-pig-the-history-of-a-taboo/Mark Essig | Lesser Beasts: A Snout-to-Tail History of the Humble Pig | Basic Books | May 2015 | 20 minutes (5,293 words)
Some excerpts -
The builders of the Great Pyramid called upon the resources of the entire Nile Valley to support this effort. The royal house sent orders to the heads of villages, who in turn sent men to the Giza site, along with grain and livestock to feed them. Workers drank beer, a muddy beverage fermented from grain and consumed more for nutrition than for pleasure. They ate heavy loaves of wheat and barley, supplemented with beef, mutton, and goat. One archaeologist analyzed some 300,000 bones at the pyramid complex and found that nearly all the animals eaten were young and male. This proved that Giza was a provisioned site, with animals raised elsewhere and the juvenile males—not needed for breeding—marched to slaughter at the pyramids.
One village that provided livestock was Kom el-Hisn, located in the Nile delta about seventy-five miles downriver from the temple complex. Villagers at Kom el-Hisn raised cattle but ate very little beef: only the bones of worn-out breeding cows and sick calves have been uncovered there. Instead, the villagers ate pork: for every four cattle bones archaeologists unearthed at Kom el-Hisn, they found one hundred pig bones. It seems that the residents kept herds of pigs that foraged in the Nile delta marshes and scavenged trash on streets. Although Egypt’s rulers demanded cattle from Kom el-Hisn, along with goats and sheep from other settlements, the villagers’ pigs were spared.
The reasons for this had to do with climate and biology. Animals destined for Giza had to walk hundreds of miles through an arid landscape, feeding on grass and leaves along the way. Well suited for such a journey, cows, goats, and sheep were herded to Giza by the thousands. Pigs, however, would not have found the food or shade they needed along the way. The state couldn’t move pigs around, so it ignored them.
This pattern appeared throughout the Near East: officials developed complex food-provisioning systems that depended on the long-distance movement of cows, sheep, and goats. Pigs didn’t fit into such schemes. But despite—or perhaps because of—their lack of usefulness to bureaucrats, pigs didn’t disappear. Instead, they stuck to their original role as scavengers. People on the fringes of society with little or no access to state-supplied food embraced them as a source of meat. Priests and bureaucrats, who dined on lamb and beef, came to despise pigs. Only the poor ate pork.
....
The rise of strong states discouraged pig raising in another way as well: by changing the landscape. As populations grew, they put increased pressure on the land. Farmers felled oaks to make way for olive groves and drained marshes to plant crops. The land, often poorly managed, deteriorated from forest to cropland to pastureland to desert, with each successive stage providing less habitat for pigs. By the time desert scrub prevailed, only sheep and goats could survive. As pigs lost habitat, they likely began to raid crops in the field, threatening the food supply and thereby earning a spot on the state’s hit list.
Pigs didn’t fit into the new political and agricultural order. As time marched on, they began to disappear. At many archaeological sites, pig bones remain common up through about 2000 bc, then dwindle away. A thousand years later, few people raised pigs in any quantity.
In a few spots, however, pigs persisted. They remained important for sites like Tell Halif that were on the margins of empire, far from the urban centers. And pigs became crucial to the marginal people living within those urban centers. Careful sifting of debris from streets has turned up shed milk teeth—baby teeth—of piglets, evidence that pigs were living and breeding among the homes of the world’s first great cities. But not everyone in those cities partook in equal measures. Archaeologists tend to find pig bones in the areas of cities where the common people lived. In elite areas, they find more cattle and sheep bones.
...
Pork eating hadn’t carried much significance as a marker of Jewish identity before the Greek conquest of Persia because most others in the region didn’t eat pork either. Since the Israelites’ return from exile in Egypt, abstaining from pork simply had been one way that they remained pure in order to preserve their relationship with God. Now, however, it also became a way that they drew boundaries between themselves and those they lived among. Indeed, when pork-eating Greeks ruled over the Jews, refusing pork became a key element of what it meant to be Jewish. You are what you eat, the saying goes, but the Jews were what they didn’t eat.
The Jews rebelled against Antiochus and in 142 bc won control of Palestine and reconsecrated the Temple, an event commemorated in the celebration of Chanukah. Their independence lasted less than a century: in 63 bc the Romans conquered Jerusalem, and the Jews once more fell under the rule of pork eaters. Unlike the Greeks, the Romans responded to Jewish pork avoidance not with violence but with puzzlement and feeble jokes. Juvenal, the Roman satirist of the first century ad, noted that in Palestine “a long-established clemency suffers pigs to attain old age” because Jews “do not differentiate between human and pigs’ flesh.” It was said that Caesar Augustus, after hearing that King Herod of Judea had executed one of his own children, joked that he would “rather be Herod’s pig than Herod’s son.”
There was a reason Jewish dining habits attracted attention: Romans loved pork with a passion matched by few people before or since. They developed the most sophisticated farming and breeding techniques that the world had ever seen and created elaborate—occasionally obscene—recipes to prepare pork for their lavish feasts. Such ostentatious pork consumption would only reinforce the divisions between Jews and Romans, and it would eventually establish pork as the meat of choice in the religion the Romans would help disseminate throughout Europe: Christianity.
Its an interesting read.