"Going through the motions" is probably what you are looking for. Competitive runners, for example, who stumble during a race and have no chance of winning will often complete the race. You could say they are just "going through the motions," but maybe they feel finishing the race is important symbolically, or simply good sportsmanship.
To "go through the motions," then, is to put yourself on "autopilot" and do whatever it is you need or want to do. While there may be disadvantages in doing so, especially when your heart is not in it and consequently you do not try very hard, there are also numerous advantages. Not the least of these is not having to learn a complicated routine all over again. Just set yourself on "cruise control" (there's another idiom that describes your phenomenon) and proceed!
When a habit becomes harmful, however, we need to re-evaluate what we are doing and why. Sometimes even experienced drivers, for example, need to take a refresher course in how to drive safely, courteously, and defensively. Likewise, when competitive athletes lose their edge and start letting their form get sloppy or begin to neglect the "basics," they need to step back and remind themselves of why they are doing what they are doing, and pay attention to how they are doing it.