He might not have had any intention of spending that long at 170 or bigger. He knows he can't stick around in that division forever because the opponents are too big. There's some guys he could've beat (could've because his prime is long gone), but he's naturally a LW, maybe even a FW, honestly.
If he put on some muscle to go up to 170 without intentions of staying there, then it would just make the journey back to 155, which is his best weight class, more difficult for him to cut to. Moving around that often in weight is really not healthy for you either. Putting on some extra muscle and then losing it not long after to cut back down isn't good for you.
BJ isn't known to be the healthiest guy around, he really isn't the best athlete 'cause he's known to be one of the lazier fighters in many peoples' opinion, yet most talented. BJ always just relied on his skill and pure fighting ability instead of his physical ability.
He did great before guys started evolving in all aspects and he eventually fell off. He truly never should've went up to fight Machida and should've tried to stay in shape more often, I think that effected him in the long run.
BJ being known to be lazy in the gym is, in my opinion, what makes him that much more impressive because he was so successful against the true elite of the elite still. If he made some better choices with his diet, didn't have all those yes men around him, etc, he likely would've accomplished even more.
Sometimes, gaining mass/muscle isn't always the answer for some fighters. Look at Jones for example - he gained a lot of muscle and then came back to fight OSP, but he didn't look even close to as good as he normally does. The long layoff is one thing but even so, more muscle doesn't always mean you'll be improved in any way, sometimes you end up not doing as well because of it.
/rant