I have a coffee grinder which has been excellent for grinding spices, and I'm currently transitioning my pantry from having many packaged ground spices to more whole spices which I can grind as needed. Are there spices that I should still buy pre-ground?
For the most part this is a question of convenience and how quickly you go through a fresh supply of spices in the quantities you buy.
Pretty much every dry spice will last better and be more aromatic and flavorful if it is stored whole. That applies to leaves, seeds, bark, you name it.
Some really hard spices like nutmeg may not be appropriate for the coffee grinder (maybe if you break it up some first?), but those are at least large enough to get a good grip for hand-grating.
One exception for me would be specialty pre-blended spice mixes which sometimes have ingredients that would be really hard to track down, or which you might have to buy in much larger quantities than you can reasonably use. (If you can get all the ingredients easily then it is probably better to blend it yourself to your own preferences and in the quantities you need.)
Another exception in my kitchen is hing (asafetida) which is a resin that in its pure form is extremely pungent and I find it difficult to work with. Commercially-prepared hing powder is generally diluted with rice flour and is much easier to use in appropriate quantities.
Turmeric, Galangal, Ginger, Garlic, Chilies, Herbs, Onions - unless you are willing to care for drying these yourself. Of course all of them can be used fresh too (I think fresh turmeric, roasted and mortared, is awesome in some dishes - but it is rather intense), but in all cases they behave slightly differently than the dried and powdered version. With the chilies, I would be wary of just grinding down whole dried chilies given that some brands state that you are supposed to wash them before using, that would in the end require you to dry them again...