I keep reading broad statements that magic mushrooms used to be very popular among early civilizations and later through the times of early Christianity. I've also stumbled on many opinions that Catholic Church is responsible for associating them with witchcraft and creating a broad propaganda against them.
How popular were Magic mushrooms in medieval rituals and life in general? Were they actively used in witchcraft/fortune telling/magic of the times? Would an average rich citizen of 12th century Germany/Poland/England know about psylocybin or have any access to it?
The Formicarius of Johannes Nider (published ca.1438) is considered one of the fundamental anti-witchcraft works of the late Middle Ages/early modern era. A few decades later, Heinrich Kramer incorporated large swathes of it into the Malleus Maleficarum, which is a good thing for modern English speakers because The Hammer of Witches sounds much more fiercesome than The Ant-hill.
But the Formicarius isn't just a series of examples and beliefs about witches--that's actually relegated to just one component book (although there are scattered elements earlier that we would associate with witchcraft today, like night flight). One of the topics that Nider covers is visions. Namely, the question of whether they are true or false--in medieval terms, that means, are they revelations from God or not.
This was a big deal in late medieval Europe. Under the right circumstances--a nun, semi-nun, anchoress, or even an outright lay woman (and less often, man) could obtain significant religious status and power by claiming to relate the words of God or receive privileged commands from God. (I wrote about Anna Laminit, one of my favorite medieval stories, for Tuesday Trivia last week). Remember, Joan of Arc was executed in 1431 as a heretic. Yes, it was a political move by the English. But the broader point is, by her time, people didn't just accept that a woman claiming to prophesy was getting her messages from God. The possibility that they came from elsewhere was not just something to raise, it was something easy to believe.
In Formicarius, among several hundred other things, Nider goes in much depth about cases of contemporary "visionaries." I'll pick on one of his favorite examples, a Franciscan nun named Magdalena Beutler who gained a reputation as a holy ascetic, prophesied her own death, didn't die, and used her lack of dying as further proof of her holiness. Nider considers three basic explanations for her enormous catalogue of visions, most of which are similar to other visions recorded by 14th and 15th century holy women and men.
First, that they are in fact divine in origin. Second, that they are natural delusions rising from within her. Third, that they are deceptions by the devil.
Nowhere in here are mushrooms or any other external substance considered. Nowhere.
Frankly, medieval Europeans didn't need shrooms to induce visionary experiences. Books and art sufficed just fine. Patterns of reading, looking, and thinking encouraged in church got people to "ruminate" over scenes of the Passion painted on altarpieces, or passages from the New Testament extracted into a little book that turned the four Gospels into a storybook. The goal was to insert yourself into the scene--first by visualizing, then by envisioning, and maybe eventually by what we might call visioning. Margery Kempe and Katharina Tucher are paradigmatic examples of women visionaries who are demonstrably catalyzing some of their visions through Passion meditation texts and standard iconography.
With all the demons crawling around the artwork in churches, and worms and bugs and signs of decay worked right into statues, it's no wonder women like Ermine de Rheims and Christine von Stommeln likewise visioned themselves battered and beaten by demons.
Medieval Europeans didn't need mushrooms to have visions or to invent an epidemic of witches in the Middle Ages and early modern era...but modern people do.
Borrowing a bit from a previous answer (but most of it is new): We need witchcraft and witch accusations to have a "logical" explanation, a "rational" and "scientific" one, because women and men in early modern Europe confessed to witchcraft.
And not just confessed. Confessed in all the gruesome, sacrilegious, titillating, diabolic detail their inquisitors could record. The pattern happens frequently enough across national/cultural/linguistic boundaries (with details varying regionally), and is found in diverse enough types of sources, that scholars are very comfortable saying: yes, women and men accused of witchcraft confessed, and named their accomplices, even knowing there was a high risk they were sentencing themselves and their friends to a horrible death.
They told stories of naked nighttime flights to have sex with Satan, of wild parties with the other witches of the town in the woods, of the deceptions they laid on other people, the things they made other people believe they saw. They said these things under oath and despite the potential, or certain, death to follow. They said these things despite them not being in the least bit true.
This should be deeply unsettling to us.
That's where the idea of hallucinogens comes in.
Whether it's ergot poisoning or magic mushrooms, we crave some kind of "rational" or "scientific" explanation for this. We need to think that something real was being hunted and exterminated; we need to think that people confessing were confessing something real. The witches, it is comforting to believe, believed what they were confessing was true, and believed it because of Science. Inquisitors, it is comforting to believe, believed they were investigating something based on an object recognizable to us today.
Because that means we can prevent it. We know the cultural difference between mushrooms and shrooms; we've got stories of LSD and religion that we recognize perfectly well are from the LSD. We're smarter than 15th century people, we're better than 15th century people, something like this can't happen again.
The intentional stimulation of visions of the divine played a major role in later medieval culture. By the fifteenth century, so did the ability to consider that holy women might be faking it or deluded. And no one needed hallucinogens to be on either--or in the case of Johannes Nider--both sides.
The short answer is that, yes, hallucinogens (notably mushrooms, maybe not psylocybin) were used in Medieval Europe. Some of the uses were medicinal (or even industrial) rather than as hallucinogens. u/sunagainstgold has already discussed mainstream Medieval Europe in detail.
The "broad statements" you refer to largely spring from the work of R. Gordon Wasson, the modern Western guru of psylocybin and friends. Wasson's most prominent scholarly work was R. Gordon Wasson, Soma: Divine Mushroom of Immortality, Harcourt Brace, 1968, in which he proposed Amanita muscaria (fly agaric) as the Vedic soma. For a detailed review including a summary of the content, see Weston La Barre, American Anthropologist 72, 368-373, 1970. Wasson discusses his research in Wasson, R. Gordon. "The hallucinogenic fungi of Mexico: An Inquiry into the Origins of the Religious Idea among Primitive Peoples." Botanical Museum Leaflets, Harvard University 19, no. 7 (1961): 137-62. http://www.jstor.org/stable/41762213 which is a (revised) transcript of his delivery of the annual lecture to the Mycological Society of America in 1960 (including the interesting note that poisonous mushrooms are/were called paganki, "little pagans" in Russia)
Relevant to the topic, he discusses the use of A. muscaria as a hallucinogen by shamans in Lapland (and by other Uralic peoples in Siberia into modern times). He notes the lack of evidence of such usage in Christian Medieval Europe, and also concludes that the Viking berserkers didn't use such fungi (this had been suggested already in the 18th century; see La Barre 1970). The use of A. muscaria by the Sami/Saami in Lapland was largely restricted to specialist shamans; later Siberian usage often specifically notes that only shamans can safely use it. It was not a common recreational drug, nor a religious sacrament used by the majority. Such religious/magical use is a possible source of their association with witchcraft and paganism, but it might also stem from their association with rot and decay, their phallic appearance, or their possible use by ancient mystery religions (Wasson notes no evidence of Medieval European accused witches in Christian Europe using such drugs).
For some notes on the insecticidal and medical uses of hallucinogenic fungi in Medieval Europe, see Brian J. Coppins & Roy Watling (1995), "Lichenized and non-lichenized fungi: Folklore and fact", Botanical Journal of Scotland, 47:2, 249-261, DOI: 10.1080/03746609508684832 (including medical uses of ergot).