A piece of ginger does not contain gluten, nor does pepper or cloves or cinnamon. Herbs and spices are naturally without the gluten which cause celiacs and people who are gluten intolerant to react.
The problems come from bulking and cross-contamination
The problem for celiacs and intolerants comes from production plants where flour is used as a bulking agent. Even if the flour is not added deliberately if it exists in the same facility there is the possibility that non-gluten product can be contaminated.
What gluten free means
The FDA definition requires that less than 20 parts per million (ppm) of product x contain gluten. This is sufficiently low that most people will not react to it. But what of a product which is gluten-free to start with? Why is it now acceptable to have 20 parts of gluten in a million?
The answer is to buy the spice unprocessed
Gluten free spices can have zero ppm if they are bought as they naturally occur. Buy cinnamon in a stick, nutmeg in a pod, cardamom and cumin as seeds, ginger as a root; you get the idea.
If you must buy processed, try and avoid powder. The more refined the more opportunity for a contaminant, however inadvertent.
Spices have a shelf-life
Spices don’t last forever, in fact the ones in your cabinet now are probably long beyond being effective. But you can grind or mill spices at home and then freeze them in small freezer bags or keep them in a small jar.
It is much more cost effective
When you buy those lovely little jars, you’re paying for it, pay for the spice and not the packaging.
Getting gluten-free will never be an issue if you get as close as possible to its natural state.