Why not the leaves? Because the green leafy part of a plant used in this way is considered an herb. Every other part of the plant, including dried bark, roots, berries, seeds, twigs, or anything else that isn't the green leafy part, is considered a spice.
Examples: Cinnamon is the bark of a tree. Cardamom is a seed pod. Allspice is a dried berry. Cloves are dried flower buds. These are all examples of spices. Note too that spices are used in dried form while herbs can be used either fresh or dried.
One thing to keep in mind when cooking with spices is that spices start to lose their flavor when they are ground. So whenever possible, it's best to grind your own spices immediately before using them, rather than using spices that are already ground. You can use a coffee grinder or mortal and pestle for this purpose.
If grinding your own spices isn't possible, try to use the freshest spices you possibly can. As a general rule, ground spices that are older than six months should be replaced.
Finally, spices last longer when stored in a cool location. So keeping jars of spices right next to your stove will significantly reduce their useful life.