The shift in focus towards ending slavery during the Civil War was due to various factors, such as the Emancipation Proclamation, abolitionist efforts, slave contributions to the Union, international influences, and changing public opinion. These factors contributed to the transformation of the war into a moral cause to abolish slavery.