A short answer is that Lee was too much bound to his notion of honor and duty. Because he considered many of those he was fighting against to be friends and assumed that they would act in like kind, he overestimated and assumed too much. His integrity and the other generals lack of it, caused Lee to be the wrong commander and contributed to the South's loss. Lee was generally indecisive at Gettysburg, partly because he was loyal to old friendships, but also because he had been ill with the flu prior to the battle.
The Killer Angels