(Note: With a general perspective, you may classify coffee as a spice.)
I imagine you mention the hand grinders. In that case, the main difference is the size of the canals of the grinders. E.g. in a black pepper grinder, the average diameter of the canals are a bit wider than the average diameter of black peppers.
However, this diameter is far narrower for coffee beans. So, you cannot grind coffee in a pepper grinder effectively as the beans cannot fit in the canals.
Summary: proper grinder for proper spice.
After Burhan added the image, I think I should make an edition to this answer.
This grinders are called blade grinders. The main disadvantage of these is the grounds are not homogenously grinded after the process. As the blades randomly cut the beans, some of them may stay intact on the sides.
Burr grinders doesn't have this possibility. All grinded pieces have a maximum volume after the process.
Otherwise, I can't think of a difference. However, you shouldn't use the same grinder for both. You don't want the aroma of your coffee to be mixed with spices and herbs. :)