Imported spices fit very well into the Greco-Roman theory of the Four Humors. We still refer to many spices as “hot” in informal conversation, even if we mean nothing particular by it. They just took it seriously.
In the early medieval years, imported spices were incredibly expensive. Charlemagne’s spices came by camel and horse train over the Silk Road, and then over the Alps. The Radhanites, early Jewish traders, brought most of Northern Europe’s spices. Of course, Italy always had other options since it was intimately connected to other parts of the Mediterranean. There was a period between the end of the Radhanites’ trading and before the First Crusade, when imported spices were very scarce; this did not slow down their use by aristocrats, and it may have enhanced their reputation as medicine.
The Crusader kingdoms and Venice’s increasing power both helped funnel much larger quantities of spices to Europe. When the Crusader Kingdoms had dwindled and ended, the Mongols were guarding the Spice Road and the Genoans had begun to explore sea routes direct to the East Indies. So the spices became gradually cheaper until in the late Middle Ages, even a wealthy town craftsman could afford pepper and cinnamon. (I think these are the two most common spices in standard American cooking for that very reason.)
As a general rule, during this period as a whole, some spices were worth their weight in silver. The heavily-spiced meat sauces served at feasts were parallel to gold flakes on the dessert and champagne fountains at modern ostentatious parties.
So to come back to medicine, although we complain about the high cost of newly-invented drugs, there is a longstanding association between expense and hope. The poor continued to use the herbs and charms, but the trained doctors for the rich ground spices with mortar and pestle, and dosed them out as prescriptions.
Spices were ranked according to their hot/cold, wet/dry properties. Pepper was hot and dry, as was cinnamon. They were emergency remedies for cold, wet illnesses. Ginger, on the other hand, was hot and wet; it was good for cooling and drying illnesses. Nutmeg was considered very drying.
Ginger does help treat nausea, and both pepper and cinnamon can help with digestion. Just when you start to think that maybe there was common sense behind the use of spices as medicine, look out. Eye disorders were cold and wet; sadly, pepper was one remedy. Placed, of course, in the eyes. Epilepsy, dizziness, and mental illness were treated with spices by placing the spices as close to the brain as possible. That meant packing them into the nose. If these remedies worked, it was by some other means, and they could have done harm.
Sexual desire was hot and dry, while fertility was hot and wet. Pepper, cinnamon and nutmeg were all recommended to increase libido, while ginger was good for fertility. One of the herbs native to the Mediterranean region (brought to Northern Europe in dried form), agnus castus, was considered the coldest herb, so it was prescribed for monks who struggled with too much libido.
Last, of course spices could help drive away “bad air,” so when epidemics went around, the wealthy wore spices near their faces. One form was the pomme d’embre, which was originally a lump of ambergris (from a whale) worn on a chain. But “pomanders,” as the word came into English, could also be lumps of wax with other spices stuck into them, perhaps in a little metal ball with holes to let the scent out. Gradually pomander came to mean any use of herbs or spices to scent the air for any purpose. Perhaps we remember the original pomme d’embre best when we stick cloves into an orange or apple, hanging it to dry in a closet.