Medicines are forbidden on shabbos for the non-critically ill because in the old days, they had to be ground with a pestle beforehand.
Must not spices also be ground? How come spices are not also forbidden?
Great question! I believe the answer is because the sages forbade using items that are meant solely for medicinal purposes. However in the case of spices you are allowed to use it for two reasons: 1: onlookers will assume you are consuming the spice for food not for medicinal reasons. 2: since using spices as a medicinal remedy isn't common, the sages didn't forbid a person from using spices as a remedy.