It violates the right of businesses and consumers to engage in free trade.
Obviously there is no such right articulated in the US Constitution, nor in any state constitution. If there were, the various state laws that ban the sale of horse and dog meat for human consumption would violate such a right, as apparently would all other of the zillions of laws that prohibit or regulate sales of something.
Anyway, I doubt it is true that Hamtramck banned the sale of pork (unfortunately). I am unable to find any source for this claim.
But, if some small town were to pass such an ordinance, a challenge to it would be in the same (or worse) circumstance as the challenge to the Illinois law that prohibits the slaughter of horses for human consumption. Since such a law does not violate any fundamental or Constitutional right, courts would review the challenge under a rational basis standard, in which the law is assumed to be constitutional and the complainant has the burden of proof to show that the law is unconstitutional. The Illinois law was naturally alleged to violate the Interstate Commerce Clause (in addition to the Federal Meat Inspection Act). But as in the case of the Illinois law, a city ordinance banning sales of pork products would not be discriminatory, which is the primary affront to the Commerce Clause (where a jurisdiction places burdens on or taxes another state’s products in order to benefit itself). Nor would it seem that a small town’s ban on sales of pork could be argued to have the potential “to distort the operation of interstate markets” in pork, in violation of Commerce Clause precedent.
Cavel quotes the important Commerce Clause exception stated in
Pike v. Bruce Church: “Where the statute regulates evenhandedly to effectuate a legitimate local public interest, and its effects on interstate commerce are only incidental, it will be upheld unless the burden imposed on such commerce is clearly excessive in relation to the putative local benefits.”
Under a rational basis review, the government does not really have to even proffer a “legitimate local public interest” unless the complainant makes a prima facie case of a constitutional violation. The court can imagine its own public policy reasons for the law. Illinois apparently didn’t offer much justification for its law, and didn’t need to. If the claims in the OP about the ordinance and Hamtramck were true, the alleged religious reason for the ordinance doesn’t really help to justify it (unless perhaps the majority of the town is Muslim). But public policy justifications often have some religious premise--such as zoning ordinances that forbid strip clubs or liquor stores within so many feet of a church.