Did they belong to pagans or did 1st century CE Jews use pigs for some non-meat related purpose? The story is in all three synoptic gospels so presumably this isn't an error made by a later gentile author.
EDIT: For anyone else planning on writing a short-lived comment about how the the gospels aren't historical sources, think about what I'm actually asking. The synoptic gospels were written (as far as we know, and assuming I'm not out of date on the historiography) in the mid to late 1st century by Greek-literate Jews living in Judea. If there was a story about pigs in them, this implies that it would have been plausible to these Judean authors, which implies that there were pigs in (or near!) Judea at the time. The historicity of the demon-casting itself is irrelevant.
The story takes place in the country of the Gerasenes. The Gerasenes were not Israelites; they were Gentiles and had no prohibitions against swine. The symbolism of the story is important. Here Jesus ministers to an outcast among the gentiles. As in other Gospel narratives Jesus chooses to help the least privileged-repected of a community.