Compulsion

A compulsion is an irrational need to perform some action, often despite negative consequences.