Sammy used to do he same thing. He would do this insane scratching in front on my daughter's bedroom door at night(the kitties are locked out of their room, because they want to wake the girls up to play!) Sammy actually made a hole in the carpet. Every morning I would find bits of the fibers of the carpet all around that spot. He thought if he dug hard enough, he would make a tunnel under the door to get in!
I also tried deterrent sprays, which did not help. I sometimes would put a strip of aluminum foil over the spot, which most cats hate the sound, and feel of. I also had gotten a towel, and then with a spray bottle sprayed vinegar over it, then placed the towel over the spot. That helped for a while, because it was very stinky to Sammy. I thought it was stinky too, but it sure beat Sammy digging himself silly every night!
I hope this may help you! Good luck!