A few notes gleaned from a quick Google search on the subject, edited together by Yours Truly...
Gargoyles were not invented by the Church. The earliest examples have been found in ancient Egyptian, Greek and Roman architecture and date back as far as 4000 years ago. The name comes from the Latin gurgulio and the old French word gargouille, meaning "throat", but which also describes the gurgling sound made by the water running through them. Along with gargoyles and grotesques, there are chimeras - figures made of a combination of many animals, including humans.
Gargoyles were introduced to Gothic architecture in the early 13th century, to keep corrosive rain water off the rooves of cathedrals in Western Europe. The most famous collection can be found at the Cathedral of Notre Dame in Paris. Grotesques became more common in the 16th Century, when the introduction of lead drainpipes meant that the practical purpose of gargoyles became redundant.
One explanation for their form is that in the 13th Century, the Catholic Church was attempting to convert pagans to Christianity. Since pagan themes and deities had a powerful history with the people, the Church deemed it necessary to use this imagery to help make the transition into a new religion more palatable. Integrating familiar images on churches and cathedrals was thought to encourage the populace to accept the new religion and ease the transition from the old ways and old beliefs. Indeed, many gargoyles from that period are similar to the legends and figures of the ancients Celts. Also, many people were illiterate, so churches used visual images to spread the scriptures and reinforce biblical stories.
Other explanations are that gargoyles (and grotesques) were intended to frighten away evil spirits. Some believe gargoyles represent deep rooted elements within human nature ... the love of the grotesque, possibly related to our desire to view horror movies, etc. They may originally (in pre-Christian times) have been inspired by the skeletal remains of dinosaurs and other fossils.
Gargoyles and grotesques have always given carvers and sculptors a chance to delight in their creativity and have offered a welcome opportunity to get away from the more mundane aspects of their craft. Artists who carve gargoyles and grotesques have frequently been inspired by elements of contemporary culture. The Darth Vader figure is therefore not a defacement of a religious building, but something which is in keeping with a living tradition.