I've watched a documentary on mushrooms. Their posion is not a defense mechanism in most (all? don't remember) cases. It is just a consequence of the fact that mushrooms need to dump the excess Nitrogen somewhere, and that is related to the fact that most posionous mushrooms are those who thrive in Nitrogen-rich environments, like a leaf forest floor. And unfortunately for us, Nitrogen is a component for many creative biologically active substances. FWIW, human is the best mushroom's friend, when you cut it and carry around you seed tons of spores, so as a sibling comment said, mushrooms would not need to develop anti-human defenses. It's just that some of them got (un)lucky when played the chemical roulette while trying to figure out how to get rid of Nitrogen waste.