There's an interesting political angle to be made here. Starting with their meeting in 1946, Eisenhower cultivated a relationship with Lee-biographer, journalist and Virginia politician
Douglas Southall Freeman, whose tomes on Lee (although winning a journalism award in the 1940s) were described by some later historians as rather hagiographical.
According to one PhD thesis on Freeman, which details the substantial extent of public and private support that Freeman poured into Elsenhower's bid for the presidency:
Freeman's public championing of Elsenhower was
important in swinging Virginia into the Republican column In
the election of 1952.
Eisenhower was one of the most politically adroit generals.
The extent to which his admiration for Lee was genuine
(probably so on military grounds) and convenient politically is
probably difficult to disentangle. It's also worth noting that the 1950s were the time when Lee made his iconic reappearance at West Point.
Freeman described Eisenhower's bid for presidency in a sort of analogous way with how he described Lee's answer to the Confederate cause--a great man reluctantly responding out of a sense of duty.
Having said this, Eisenhower was neither the first nor the last 20th century US president to say complimentary things about Lee. Eisenhower perhaps does stand out a bit with the extent of his professed or at least explained his admiration, in the second half of the century (although Woodrow Wilson surely exceeded it in the first half, himself having written a book on Lee). Eisenhower's letter to a dentist that is often brought-up on this matter pretty much describes Lee's participation in the Civil War along standard Lost Cause terms, namely that Lee was allegedly fighting for the idea of secession being a states right and it makes no mention of slavery.
General Robert E. Lee was, in my estimation, one of the supremely gifted men produced by our Nation. He believed unswervingly in the Constitutional validity of his cause which until 1865 was still an arguable question in America; he was a poised and inspiring leader, true to the high trust reposed in him by millions of his fellow citizens; he was thoughtful yet demanding of his officers and men, forbearing with captured enemies but ingenious, unrelenting and personally courageous in battle, and never disheartened by a reverse or obstacle. Through all his many trials, he remained selfless almost to a fault and unfailing in his faith in God. Taken altogether, he was noble as a leader and as a man, and unsullied as I read the pages of our history.
From deep conviction, I simply say this: a nation of men of Lee’s calibre would be unconquerable in spirit and soul. Indeed, to the degree that present-day American youth will strive to emulate his rare qualities, including his devotion to this land as revealed in his painstaking efforts to help heal the Nation’s wounds once the bitter struggle was over, we, in our own time of danger in a divided world, will be strengthened and our love of freedom sustained.
Such are the reasons that I proudly display the picture of this great American on my office wall.
Eisenhower's letter also praised Lee's post-war reconciliation efforts, but left out that Lee also called for a restoration of white rule in the South even after the war (although that fact can be found in Freeman's books.)