In 2014, drugs and alcohol are used primarily for pleasure and not to commune with nature or contact the spirit world.

In ancient times, opium poppies and hallucinogenic mushrooms were for gifted elites and their use went hand-in-hand with shamanistic belief systems and the sacred burial rituals of pre-industrial societies, according to a recent paper. 

Consumption of these substances is clearly ancient - their properties were discovered being someone stuck them in their mouth and things got weird. Yet putting together an anthropology of intoxication is difficult so trying to draw science from cultural references leads to a lot of speculation and conjecture. Modern science can help create a clearer picture and Elisa Guerra-Doce of the Universidad de Valladolid in Spain examined research on the use of mind-altering products in Europe. There's nothing new in there, but at least it's gotten some unified context.

In the research, four different types of archaeological documents were examined: the macrofossil remains of the leaves, fruits or seeds of psychoactive plants; residues suggestive of alcoholic beverages; psychoactive alkaloids found in archaeological artifacts and skeletal remains from prehistoric times; and artistic depictions of mood-altering plant species and drinking scenes. These remnants include bits of the opium poppy in the teeth of a male adult in a Neolithic site in Spain, charred Cannabis seeds in bowls found in Romania, traces of barley beer on several ceramic vessels recovered in Iberia, and abstract designs in the Italian Alps that depict the ritual use of hallucinogenic mushrooms.

Because Guerra-Doce mainly found traces of sensory-altering products in tombs and ceremonial places, she believes such substances are strongly linked to ritual usage. No surprise if they were consumed in order to alter the usual state of consciousness, or even to achieve a trance state, or simply to take away pain and ease death.

There's no way to know, behavior and motivation are often conjecture, but they clearly did use them for something. And there would seem to be little reason to use them for fun while dying.
A common hypothesis is that the substances were either used in the course of mortuary rites, to provide sustenance for the deceased in their journey into the afterlife, or as a kind of tribute to the underworld deities.

Was use of such substances highly regulated, given that they were a means to connect with the spirit world?  Guerra-Doce believes so. 

"Far from being consumed for hedonistic purposes, drug plants and alcoholic drinks had a sacred role among prehistoric societies," says Guerra-Doce. "It is not surprising that most of the evidence derives from both elite burials and restricted ceremonial sites, suggesting the possibility that the consumption of mind-altering products was socially controlled in prehistoric Europe."

Published in the Journal of Archaeological Method and Theory.