How could taking psychedelics be evolutionarily advantageous if, when you're tripping, you’re more susceptible to fall victim to an attack from a tiger or some other threat that could result in death? It would seem to be disadvantageous to ever be incapacitated mentally and physically because a predator can attack at any time. In the prehistoric wild, there would have been no safe time to be tripping on psilocybin mushrooms or ayahuasca. Psychedelics would make you too slow or unable to move at all. Those who tripped often would likely die.
The only way those who took psychedelics could survive is if the rest of their tribe stayed sober to protect them. Perhaps that was one evolutionary advantage of psychedelics: it brought humans closer together into tight-knit tribes where they cooperated and protected each other. Psychedelics gave humans the consciousness to work together and protect those who are weaker. Yet psychedelics still make you vulnerable to attack, so it wouldn’t be advisable to take them often.
The hallucinations themselves could be an evolutionary adaptation of the plants (and fungi)—a defense mechanism of the plant trying to convince the person consuming it to stay close to nature and not build technology. There is a sort of war between nature and civilization. The plants see that human technology will destroy most other plants and animals on the planet so they are using psychedelics to fight back.
Then again, that doesn't necessarily mean humans are not supposed to create technology. It may very well be the opposite. Humans are supposed to build technology, culminating in superintelligent AI. Humanity's destiny may be either to give birth to AI to supplant us, or to merge with AI and achieve immortality through uploading our consciousness.
However, the plants are trying to stop the singularity out of their own self-interest of survival. Perhaps that's why primitive tribes never develop technology. They are under the influence of psychedelic plants, whose goal is to suppress technology to preserve nature and the planet in the war against humans and AI.
That may be the ultimate evolutionary advantage of psychedelic plants: to make humans appreciate those plants so they continue to cultivate them. The plant’s goal is to spread its seeds and live forever (just like humans and all other life forms). Plants pursue this goal as species, not individually. They are willing to sacrifice themselves to be eaten or smoked. The ensuing hallucinations could be a form of afterlife or immortality for them. They become one with the person who ingested them, who in turn becomes one with the universe.