I don't think they do. AFAIK most of your assertions above are unknowns.
My theory, at least re: psilocybin and the like, is that a parasitic fungus developed neurotransmitter agonists as a way of manipulating its host. The complete cocktail that was needed to make the target species behave in a way that completed the fungus' lifecycle may be lost to time, but certain components of it still exist in the gene pool.
And if you're going to have millions of spores (rather than the two or three offspring that, say, humans have) you can afford to set them up with a wider array of gene expression profiles. So you've got these fungi just trying stuff to see what works--now armed with neurotransmitter agonists as part of that "stuff".
Later on you've got other organisms eating those mushrooms and behaving strangely. If you're a fungal spore, and you're in an animal's digestive tract, "strangely" is probably how you want it to be behaving. You're going to end up in a different place or with different nutrients or in some other situation which is abnormal for your host--you end up with greater habitat diversity.
How specifically that host-behavior-strangeness would lead to a lifecycle that would reinforce the inclusion of psychedelics to the point where P. Cubensis is reliably psychedelic, rather than just the occasional mutant, I have no idea, but when you've got billions of years to play with, it's not hard to accept that some pretty weird animal-fungus interactions came up here and there.
https://en.wikipedia.org/wiki/N,N-Dimethyltryptamine
https://en.wikipedia.org/wiki/Melatonin
Just a slight mutation, or even biological synthesis under non-ideal conditions could easily result in synthesizing one or the other via the same pathway.
There is a lot of complexity in a million years of mixing spores and mycelial karyotypes. I haven't done the math but it seems like it could easily rival a human brain.
I think marijuana or poppies have less plausible explanations for how they would have evolved specifically to mess with animal's minds.
Sometimes we need a little shove to start doing new things that end up being advantageous. There's no reason to believe that we're unique in that way. If that shove is advantageous enough to be worth returning for a second shove, well now you've got the seed of a cross-kingdom relationship.
That is, in fact, exactly the reason.
You are of course correct that synthesis of many biological molecules has evolved countless times over the eons, but chirality of certain critical molecules, amino acids, ribosomes, all evolved exceedingly early. Once the cellular machinery is synthesizing these things, synthesis of similar molecules, one, two, three mutations away become likely across swaths of related organisms, however distant.
In short, we're all playing with the same lego bricks, and there are only so many different models possible to build with the set.
The synthesis of opium, for instance, requires two specialized cell types, complex organelles, and hundreds of different proteins, all told requiring thousands of different genes [1]. This is all for the purpose of creating one single highly-complex molecule. This isn't something you get at easily by "playing with the same Lego blocks."
The question is, if it's not a coincidence that both poppies and a small subset of animals both go through all this work to create two versions of this extremely-specific molecule, then what's the reason?
Sure, in the end the reason will be "it's advantageous for both species," but it's still pretty mind-blowing, and I think we're still missing a bunch of steps.
Also, this is not a refutation of your point, just interesting, but complete opioid synthesis has been engineered into yeast by at least two different teams at his point: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4924617/
But like many things in biology, if you view it through a billion-year evolutionary lens, it's not completely surprising. I doubt anybody could come up with a general rule or law that explained this well, and anything I did would just speculative arm-waving, of which this site has enough.
Both sets of species are each doing a whole bunch of work to create these very specific, very complex molecules, and using them for different purposes.
Us and plants aren't creating the same molecule because we share a common ancestor. There are far too many other plants that don't create cannabinoids or opiates or whatever, and far too many other animals that don't create them, for this to be at all likely. It had to have evolved multiple times.
It's not any kind of symbiotic relationship. Our ancestors didn't cause opiates to evolve by selectively eating and spreading their seeds.
So it's a coincidental convergent evolution. But these are really complex molecules doing quite different things. Both cannabinoids and opiates evolved in plants to defend them from viruses and fungi. I don't know what other neurotransmitter-mimics are for, but they're not being used for plant nerves.
I'm sure people know the answers to this, and I could read a book about it.