Because of post-war politics in the American south and the formation of the lost cause ideology. During the war Lee was certainly popular and successful, but post-war he gained a sort of godhood in the American imagination. This is because he largely stayed above the vicious fray (and of politics in general) post-war where other Confederate generals tore each other to pieces. And because he convenient died in 1870 and therefore was not a part of post-war southern politics directly.
At the same time a number of Lee's successful lieutenants discredited themselves/were discredited by others: the best example of this being James Longstreet who became a Republican after the war and converted to Catholicism and was viewed as a virtual Judas in the south. Jubal Early, another ex-CS general, launched a series of vicious slanders against Longstreet, blaming Confederate defeats on him even when Lee had previously taken responsibility for those battles (i.e Gettysburg). Longstreet, despite being quite a farsighted general during the war who was one of the first to recognize the power of defense over offense when it comes to modern firepower, never recovered from those attacks and his reputation is low even today.
Another example is Wade Hampton, another exemplary military officer who discredited himself with his aristocratic style of leadership in post-war politics among poor whites in southern states. Despite once holding a position second only to Lee in the lost cause mythology his name is largely unknown today because politics made him unpopular.
Lee was therefore, a kind of perfect figure for the lost cause mythos. He embodied enough of "southern virtue" to be considered a Christ figure. He was well known since he commanded the most important army in the CSA (Army of Northern Virginia). His defeats can be blamed on a Judas (Longstreet) and he never had enough rope to hang himself politically post-war. I think it is also no accident that the other revered general in the lost cause: Stonewall Jackson, was killed during the war itself.
On a purely military side of things, General Lee is highly respected for the fact that he had a strong grasp of OODA (observe-orient-decide-act) and mobile operations. Unlike McClellan, for example, Lee was very good at processing information rapidly and taking advantage of opportunities offered by the enemy.
The two best examples of this are the battles of the wilderness, Chancellorsville and The Battle of the Wilderness. While he lost the second one, in both cases he was able to correctly glean the goals of his much larger opponent, redirect his forces in response and subsequently attack them while they were strung out and moving, maximizing local concentration of force. This strong emphasis on mobility and reaction, combined with subordinates who could be relied upon for independent action, was in large part what allowed him to fight for so long while outnumbered. Lee's strengths were in minimizing the odds against him at any one time and maximizing force against subsections of large Union armies. Even in the case of Fredericksburg, where he was fighting a straight up defensive slugfest, Lee's committing of his reserves to stopping Meade's potential break through is what ensured his victory there. This complimented his final strength, the range of latitude allowed to his subordinate officers. The Union, meanwhile, didn't reinforce Meade because division officers were afraid that it would go against orders, despite being a classic example of a potential opening.
The problems he faced were usually when he couldn't do that. Lee excelled in mobile operations and when faced with dug in troops with anchored flanks, he often fell into the trap of attempting aggressive action, with the most spectacular failure being Pickett's charge. In short, Lee was the type of officer who would have been a nightmare in World War 1 and a god send in World War 2 and beyond. His willingness to rapidly orient and take advantage of openings is a rare trait in an officer and its lack, for example, is what greatly contributed to the long length and bloodiness of the Italian Campaign of World War 2.