Humans are pair-bonding mammals meaning we are biologically designed to need and love one another. A romantic bond is not dissimilar from a maternal instinct - it's just something we naturally know how to do and once we've turned on the light switch it can be very painful to turn it back off. Literally, your mind and body can be working against you when it comes to getting over your ex so you have to be stronger than your instincts and more persistent than your addiction to get through the initial phases of withdrawal. Trust me it only gets easier but it could be years or even a lifetime until you stop thinking about that person, even if just in passing.
Remember just being crave something doesn't mean you are meant to have something. If so, we would all have a strict pizza diet. Your basic instincts often doesn't know the difference between what's comfortable and what's healthy - but you do!