In "bible times" pigs were especially prone to particular deadly diseases and in hot climates pig meat very quickly attracts plenty of nasty bacteria.
Hence it was banned - because there was a good chance eating it would kill you.
Nobody really knows the real reason for the ban since its origins are in prehistory.
There are several different hypotheses, like the one that you give. This particular hypothesis has the weak point that it doesn't explain why a similar prohibition didn't happen in other areas of hot climate -- pigs have been happily eaten all over SE Asia for millennia and I'd guess that pig meat spoils even quicker there.
I'm not so certain that there was a practical reason for banning pig meat. Pig is not the only mammal that is specifically mentioned as prohibited in Leviticus 11: camel, coney, and rabbit share this fate.