In ancient and medieval days water spouts were placed onto buildings to help divert water from the other parts of the roof. Oftentimes these were carved into monstrous shapes, which came to be known as Gargoyles.
Standing guard over their rooftops and villages, Gargoyles in medieval times were thought to ward off evil spirits and monstrous beings. Some even thought that the Gargoyles would come alive at night, and that the ones with wings would soar over the village and protect it from evil.
Over time Gargoyles were carved more and more grotesquely, the belief being that the uglier they are, the more they'd frighten off bad things. Eventually they fell out of popularity and no more roofs were adorned with their hideous protectors.
Today Gargoyles have taken over all sorts of places in stories, but a common reacurring theme is their protective or defensive roles, not totally forgotten despite the test of time.