Again, there are genetic mutations which make certain other mutations more likely. A beneficial mutation which spreads widely can eventually cause a plurality to carry a gene that is neutral or even harmful by giving it a ride on its own selective pressure.
Furthermore, complex systems are susceptible to emergent behavior. For example, is our brain selected by nature to undergo altered consciousnesses in the presence of some chemical substances? Probably. Should we then believe that nature has "selected" our brains to be altered by every psycho-actice drug that exists? Probably not. Some of these are certainly "happy" accidents by which the chemical function of our brain also happens to be impacted or interfered with by some other chemicals, thus inducing a "high".
The argument could be made that this serves some vast evolutionary purpose, but then we're back to inventing gods for ourselves again. (And in any case, such a theory would need also to explain why wasps also enjoy getting drunk, this being after all another example of the same behavior. Evo-psych types being as anthropocentric as they are, this never seems to be addressed, but it needs to be if they want the intellectual coherence to which they so anxiously pretend.)