Without being able to (or wanting to) reveal the knowledge of bacteria, germs and viruses to ancient man, the best God could do was to basically ban certain types of foods and give specific instructions on how others were to be prepared.
It may sound silly... but I get the impression that God sort of operates under something similar to the “prime directive” from Star Trek for the most part. In that he is very careful not to interfere to much with our development.
I certainly agree with God’s laws being for our benefit. In regards to the dietary laws that is especially true and that is why Jesus didn’t say that those “unclean” foods are now clean.
The reason for what he said was to reinforce His authority and ABILITY take something different than what it usually is. The entire focus was His authority and power, not the food itself.