Research has suggested that compulsive behavior persists because

It diverts the attention of the individual from the problem

Others begin to expect it

It reduces anxiety

There is some underlying conflict