Going through the long training hours for two prime crew assignments with little chance of actually landing on the moon would be frustrating especially when Shepard was given a command assignment (originally on A13 if I'm not mistaken) despite his minimal space flight experience. You'd think Deke could have at least offered Anders a spot as an LM pilot. I guess McDivitt wasn't interested in any more Apollo flights.
Slayton had indicated that he wanted at least one of the original Mercury 7 to go to the moon. Cooper, Carpenter and Schirra were in the dog house, Glenn was in orbit in the Senate, Grissom was dead and he still had the heart problem. That left Shepard to command the A14, as NASA wanted to give him more time to train, since he hadn't been on the regular rotation with his ear problem.
McDivitt had already had a command and probably guessed that he would not have another command, but that is my surmise as I didn't know him.