It's all in the timing
A striking graphic from the Southern Poverty Law Center revealed that the majority of Confederate monuments weren't erected until after 1900 — decades after the Civil War ended in 1865. Notably, the construction of Confederate monuments peaked in the 1910s and 1920s, when states were enacting Jim Crow laws, and later in the 1950s and 1960s, amid the Civil Rights Movement:
The chart illustrates upticks in the construction of Confederate monuments on courthouse grounds after the landmark Plessy v. Ferguson case in 1896 upheld state segregation laws. The construction of monuments outside of schools jumped after the 1954 Brown vs. Board of Education ruling, in which the Supreme Court deemed state laws segregating public schools to be unconstitutional.
Shortly after the Civil War ended, Confederate Gen. Robert E. Lee argued against erecting Civil War monuments, which he warned would "keep open the sores of war" instead of helping to "obliterate the marks of civil strife and to commit to oblivion the feelings it engendered."
Indeed, 151 years after the Civil War came to a close, white nationalists and counter-protesters clashed Saturday in Charlottesville, Virginia, over the city's decision to remove a Confederate statue — which was, ironically, of Lee.