Try to teach him a "no" command or a "leave it" command. Tell him one of the commands (only use one command or it may confuse him) very firmly and never ever let him in while he scratches as that is rewarding him for scratching. Wait until he stops scratching to let him in. Maybe nail a piece of carpet in the spot or hang a bell on the door & teach him to ring it to be let in. If he has a lot of wolf &/or he has been doing this for a long time he may be stubborn & a little hard to re-train. Patience & practice & he should learn.