The origin of this quote, in this form at least, is unknown – but it is not Shakespeare. No one has been able to find a reference in Shakespeare’s works to these words, though it is a matter of opinion whether you might find something similar that Shakespeare said, that has evolved into the above.
Actually, this quote closely resembles the Second Noble Truth of Buddhism, which is often expressed as “Desire is the root of all suffering.” What is expectation but desiring a certain outcome? If we do ever find an actual “source” for this quote it will be difficult to argue that they’re not just paraphrasing (or maybe even just translating) Buddha.
If you’d like to pursue that thread some more, you wouldn’t be the first person to consider a Shakespeare/Buddhism connection.