How is it that zinfandel can taste spicy?
This has to do with esters, which are flavor compounds created during fermentation.


  Each grape variety has a unique physiological make up with aromatic compounds found in trace amounts within the grape skin cells. The concentration of each of these aromatic sensations is dependent on the grape type and is mostly undetectable until the juice is fermented. Fermentation magnifies and makes these aromas more easily perceived by the nose, so think of wine as a caricature of the grape.


From winegeeks.com.

another good reference

about the pepper flavor specifically, although in Shiraz I imagine it's the same or similar to that in Zinfandel:


  Australian chemists have identified the compound responsible for the peppery aroma of the country's iconic Shiraz wines - and discovered the same molecule is by far the strongest aroma in peppercorns themselves.