While some people classify garlic as a herb, others call it a vegetable and some people refer to it as both. When trying to define garlic as one thing in particular, it is important to look at the characteristics of both spices and herbs. Herbs are usually green in color and are derived from a plant of some sort. A spice seems to indicate something like root, seeds, or bark, none of which garlic is. Garlic is actually closely related to onions, shallots, and chive.
You will find that most people will refer to it as a vegetable because of the characteristics is possesses. The fact of the matter is that garlic is a unique type of food that could be considered an herb or a vegetable, though it is most likely not a spice, at least not in the traditional sense.