I wish I knew, and even when I have met others with this same problem it's just as perplexing.
I would say for me it has a lot to do with not being able to believe that it's even remotely possible that somebody could love me. A lot of times this comes as a form of a question like, "How could they love me if they knew who I really was?" Also trust is a big issue. I can't trust whether or not what I'm being told is true or just superficial bullshit. And I guess one of the most significant reasons is that to some extent I hate myself so I end up sabotaging myself so that I don't receive love, because well, I hate myself so I don't deserve it.
It's different between everyone I guess, so I just give you examples from me.
As to what would it take for you to be able to give and receive love, well if I knew I guess I wouldn't have this problem. Part of me understands it's a delusion, but part of me believes this delusion. It's an inner struggle, and if someone hates themselves, I don't see how it's possible for an outsider to help them if they're not open to the help in the first place. I've been told many times that you can't help someone who doesn't want help, idk if I believe that though, but I do know it holds some truth.