Pirates did not release them so that they would not get killed in the raids.. and most likely both groups fighting for ownership of the islands released hogs onto it.
It was common practice to release hogs into the wild, they were not the pigs we have today, they were smaller with more muscle and larger tusks. They released them because the livestock of the day were able to fend for themselves. Its cheaper and easier if you dont have to house and feed an animal just to eat it. Pigs breed like crazy and can quickly over run and destroy an island/ecosystem.
Its one of the reasons we still have wild boars in some parts of the U.S.