The brushing doesn’t help. The teeth decay is from lack of saliva.
I think it’s more because it’s a simple task that feels productive. It satiates the desire to be doing something without introducing the added frustration of failing at a more complex task.
In the way that meth is kind of like Adderall for addicts.
I lived in an apartment for a while and the upstairs neighbor decided to get addicted to meth and vacuum their floor every 30 minutes for a few days, both day and night.