I have always believed it when told that a dog chases his/her tail it is from boredom, but after much investigating into this problem, I found it is not boredom that makes a dog chase his/her tail but worms..
I had one dog here that even when out playing and exercising the dog would still chase its tail.
Mostly if you have cats around, your dog most likely has Tape Worm, please do not go to some pet shop for a wormer, but go to the vet and ask for Tape wormer, as they are very hard to get rid of....most pet shops do not have a wormer strong enough to kill the parasite.

Tapeworms are parasitic worms that infest the intestinal lining and other organs of vertebrates. Tapeworms, having no mouth or digestive tract, are able to absorb partially digested material through their body surface

Tapeworm, common name for intestinal parasite of vertebrate animals (see Parasite). Tapeworms are flattened worms ranging in length from about 13 mm (about 0.5 in) to about 9 m (about 30 ft). The adult tapeworm is characterized by the presence of a head, or scolex, equipped with a crown of hooklets for attachment to the intestinal lining of its host. At the rear end of the scolex is a narrow neck, from which body segments, or proglottids, are budded off asexually. Tapeworms may have as few as three or as many as several thousand proglottids. The proglottids contain organs of sexual reproduction, each with both testes and ovaries; the segments farthest from the head mature most rapidly and, when ripe, separate from the main body of the worm and pass out with the feces of the host animal. These newly detached proglottids contain numerous eggs, and each egg contains an embryonic tapeworm.

When the living segment is ingested by another primary host, the proglottids regenerate a new scolex, which attaches itself to the intestinal wall, and the tapeworm resumes its growth by budding. When eggs are ingested, they hatch in the intestinal tract and release larval forms, which burrow into the tissues of the host and form cysts (see Cyst). These encysted forms are known by such names as bladder worms, cycticerci, hydatids, and measles; the host harboring this stage is known as an intermediate host, in contrast to the primary host, in which the tapeworm seeks the alimentary canal and develops there. The larvae often exhibit specific selection of tissues in encysting; for example, one species attacks the liver in humans and dogs, whereas another attacks the brain in sheep, causing the disease known as gid or staggers. When larvae are ingested by a primary host, usually in the form of encysted meat of the intermediate host, they are stimulated by the gastric juice to develop into adult tapeworms. The adults attach themselves to the intestinal wall and absorb partially digested food through their body surface; tapeworms have no mouths or digestive canals.

Several vermifuges, poisonous worm-killing substances, are effective in proper dosages in treating tapeworm infestation. Unless the scolex is dislodged, the worm is not eradicated.

Scientific classification: Tapeworms make up the class Cestoda. The tapeworm larva that attacks the liver in humans and dogs is classified as Taenia echinococcus. The tapeworm larva that attacks the brain in sheep is classified as Taenia coenurus.