Which spices should be bought whole vs. 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.