They largely went up in two waves, in the 1890s and the 1960s, as explicit symbols of white supremacy. They were not erected shortly after the war to commemorate soldiers. They falsely evoke a time right after the war when Southerners held great respect for confederate "heroes," but that's misleading. I was surprised to learn this too.
http://www.townandcountrymag.com/society/politics/a12015570/... https://www.google.com/amp/jezebel.com/confederate-monuments...