Yes, you can use them to grind spices as well.
Grinding coffee just before brewing preserves the beans' freshness and flavor.