Our happy brain chemicals (dopamine, serotonin, oxytocin, endorphin) are inherited from earlier mammals. They did not evolve to make you happy all the time. They are meant to motivate you to go toward things that promote your genes, and warn you to avoid things that threaten your genes. No conscious interest in your genes is involved - these chemicals create such strong impulses that we search for information to make sense of them. That's the job of our big cortex. It's not easy being a mammal, but your ups and downs are easier to manage when you know the job they do in the state of nature.