You probably need "to love" more than "to be loved."
This may be a reflex, conditioned in childhood when you felt more secure only when you were doing something in order to win your parents' approval.
He had been physically not yours for some time. Now he is entirely someone else's, it's a loss for you, even though it is incorporeal.
This kind of childhood imprint is hard, if not impossible, to change. But realizing it is one step forward. Love yourself more, directly, rather than going the route via loving someone else first in order to get love for yourself, may need to be raised into the conscious level.