That's kind of a big question because the role of the pigs is one of the most important in the book. Also, there really isn't a "bad" importance or a "good" importance, but there are ways that the pigs acted "bad or good."
The pigs do some things that are positive for the farm.
- They are able to get things organized quickly because they are more clever.
- They quickly begin to "right" some of the wrongs that were done by the humans. The animals, at first, are better fed and happier because of the organization that the pigs are able to bring.
- The pigs are also able, later, to arrange to trade with the humans for things not available on the farm. Granted, that mostly turns out bad for the other animals (like the Chickens who lose their eggs) but the ability to deal with the outside world would be important for things like vet care.
- Old Major, the grandest of the pigs, is the one who starts the whole ball of revolution rolling.
- Snowball has some great ideas regarding farm government and inventions like the windmill.
- The pigs organize the defense of the farm
- The pigs can read and so they learn how to do things around the farm
The pigs also do some rotten things, or have a "bad" role:
- They chase out Snowball
- They arbitrarily change the rules
- They pamper themselves
- They sell the horse to the slaughterhouse
- They train attack dogs to use against the animals
- They adopt the bad qualities of the humans, and in the end, become like the humans they overthrew
- They understand how to lie.
Overall, the pigs show us the good and bad parts of human nature. They can be clever, brave, and hard working, but once they have too much power they become lazy, violent, racist (or is it speciesist?) and greedy. There role in the book is to represent our leaders and how too much power can be a bad thing for people to have.
A much longer argument could easily be made that the pigs actually represent the communists in the Russian Revolution, and that Napoleon is a thinly disguised Stalin or something, but that wasn't specifically your question so I will save that for another day.