It was an interesting time when few people were educated and just did what their parents taught them spreading some good tips and a lot of misinformation. The religions were the best source of actual education at the time. Easier to say “don’t eat pork or shellfish” than try to explain the subtle difference between safe and unsafe storage.
There’s a post somewhere on ask historians I think about this. It said that while there is some overlap between health and this type of rules it’s not consistent and the real reason was to separate your group from the others.