You are more likely to go to the gym if it is on your way to work because stopping doesn’t add much friction to your lifestyle. By comparison, if the gym is off the path of your normal commute—even by just a few blocks—now you’re going “out of your way” to get there.