When dogs eat carpet, it is a sign that the dog is looking for grass to help it regurgitate. Usually, dogs look for something comparable to grass when they are inside, which is either a plant, or more often, the carpet.
According to About.com, dogs usually eat grass when they feel nauseous and need to vomit because it facilitates the regurgitation process. When a dog is indoors, however, no grass is available, which means it attempts to eat the carpet instead. According to APSCA, an animal rights nonprofit organization, dogs graze on grass for a variety of reasons including nausea, lack of nutrition or worms. Regardless of the specific reason, if a dog is grazing, it is because the dog is having a digestion or nausea issue. This means that a dog attempting to eat the carpet is most likely attempting to graze on grass and should be taken outside immediately.
Aside from nausea, dogs also eat non-food items because of a condition called pica. When dogs have this condition, they eat a variety of non-food items, such as plastic containers, clothing, wooden objects and rocks. Eating rocks is the most common sign that a dog has pica, which also is a sign that the dog is lacking in nutrition. However, if the dog is a puppy, more than likely the dog is merely suffering from boredom. Consult an expert if the dog continues to eat carpet or has problems with digestion.