According to Lauren Faust , creator, writer and Senior Animator of "Friendship is Magic", the pigs were kept for humanitarian (pigitarian?
ponitarian?
) reasons as well as to help the ponies to locate truffles.
Obviously it can't be for food, given that ponies in Equestria are
strictly vegetarian
scifi.stackexchange.com/users/20774/Valorum
Equestrian ponies are not exclusively herbivores.
That looks like a meat sandwich to me, and Pinkie Pie references hot dogs in Fall Weather Friends .
One could argue that they're vegetarian equivalents, but that just pushes the notion back to "equivalent of what ?
" The presence of a vegetarian hot dog implies an original meat hot dog for it to be mimicking.
Equestrian ponies aren't like real-world ponies in many ways.
Being omnivores is one of these differences.
(It doesn't seem that they eat a lot of meat.
Faust's justification of pigs as truffle-hunters is probably also true, perhaps even primarily true, but it probably isn't the entire truth.
Please note, even in an unofficial off-the-cuff answer Faust didn't indicate that ponies don't eat meat).
scifi.stackexchange.com/users/13941/BESW
The ponies are shown several times baking and cooking various meals and dishes.
Some of these require some kind of fatty substances that could be pig lard.
They also wear clothes sometimes, for which they could use pig leather.
Pig hooves can be used to fabricate buttons that can also be used to make dresses.
scifi.stackexchange.com/users/21504/zovits
What are pig farms used for?
To dispose of the bodies!
(see Snatch and True Blood , for example)
In this context, as previously mentioned , no graveyards - so where do the corpses go?
scifi.stackexchange.com/users/21551/KevinM
Let's see what non-pork uses are there for raising pigs.
Truffles!!!
Plowing/land clearing Fertilizer Boar's hair for brushes Waste products can be used to generate electricity
scifi.stackexchange.com/users/36147/Brouellette
From everything I've seen so far, the ponies seem to be herbivores. We never see them eat meat products of any kind. But the Apple family raises  pigs  in their farm (Season 3 Episode 10 "Spike at Your Service"). It makes sense for ponies to raise sheep (for the wool), cows (for the milk) and chickens (for the eggs), but why would they need to raise pigs if they don't eat meat?
If the ponies are vegetarian, why do they raise pigs?
scifi.stackexchange.com
<my-little-pony-fim><my-little-pony>
scifi.stackexchange.com/questions/48040
scifi.stackexchange.com/users/887/System Down
According to  Lauren Faust , creator, writer and Senior Animator of "Friendship is Magic", the  pigs  were kept for humanitarian reasons. Faust's justification of pigs as truffle-hunters is probably at least partly true. The pigs were kept for humanitarian purposes. Moreover, the pigs were also kept to help the ponies locate truffles. 
The pigs were kept for humanitarian purposes. The pigs were also kept to help the ponies locate truffles. 