Research has suggested that compulsive behavior persists because

It diverts the attention of the individual from the problem

Others begin to expect it

There is some underlying conflict

It reduces anxiety