It's possible that it is a self-worth issue and lack of self-love. Overconfidence is a defence mechanism, and not being able to take compliments is a sign that you don't truly, deep down, believe people are being honest about them.
However it can be quite complex and let's say you have trust issues... an example is, let's say you didn't get many real compliments and were bulled in school and every time you wore a ratty shirt or didn't brush your hair, your bully 'complemented' it in front of others. Now you're primed to distrust complements and believe on a subconscious level that they are malicious.
Compliments are often used as a way to manipulate people, so if you've dealt with a manipulator before, now genuine comments may trigger you to have your guard up... not an easy place to be when trying to genuinely accept compliments.