The years 1865-1877 was the so-called Reconstruction Era. The Reason for this reconstruction was the devastation of the country during the Civil War.
Additionally, the South had to be transformed from the point of view of the North: with slavery abolished, many social changes had to be introduced - this was the other reason for Reconstruction.