I had been under the (mistaken) impression that the European demand for spices were to preserve and flavor meat due to the lack of refrigeration, but if that isn't true then why was there such a high demand in Europe for these spices?
Simple, the same reason they are now, because people like well seasoned food, since it is more flavorful. The important part is the monetary density of the spices.
Even if only a small percentage of the total spending on food (say 1%) is spent on spices, that's still an incredibly large market. Now consider how little spice is actually used to flavor a food. So if people are willing to spend 1% of the value of their food on something that is perhaps 0.1% or less the mass of the food, that implies the monetary density of spices might be 10x or more the value of food. More so, because many spices are dried (such as peppercorns) they can be transported long distances and still remain commercially viable.
Even at today's prices a simple middle ages Carrack could carry over a million dollars worth of peppercorns. Consider how much more valuable spices were then, due to their comparative rarity, and that gives you some impression of how it was so worthwhile to deal in the spice trade.
Ultimately it comes down to the size of the market. Food is universal, and the desire for good tasting food is as well. The market for spices is damned near everyone who can pay for it, it's similar in scope to the market for food, which is an enormous market. The other side of the equation is that the durability and density of spices means that it's feasible for a single supplier to service vast continent wide markets. It's the same reason why the drug trade is so lucrative. It's widespread, the goods are reasonably durable (they will survive without preservation for months) and dense, and there is sufficient demand relative to the cost of production such that there can be large margins at every step in the distribution chain.
As already posted here, they made things taste better, so that's step 1. The rarity contributed to a high price, which in turn fed a demand for spices as a luxury item for conspicuous consumption. Important to also mention is the Galenic theory of medicine (balance of humours); spices, due to their nature, flavour, and origin, were generally considered to contribute heat and dryness, which made them important in rectifying the wet/cold imbalance that was thought to cause disease, especially during fasting seasons in Catholic Europe, in which those wealthy enough to afford spices were likely to eat a great deal of fish.
I strongly recommend Krondl's "Taste of Conquest" for much more on this in an interesting and approachable treatment of the history of the spice trade in Europe.
hi! there's always room for more input, but meanwhile, check out a few perspectives from these previous posts
He who controls the spice controls the [world] ?
Why were spices such a big deal when they were discovered?
Why did Europeans rely on trading spices instead of growing them locally?