To the extent that the slavery issue was the cause of the Civil War, it was certainly morally justifiable. When something as immoral as slavery is being done in a country, we can say that it is moral to fight against that country to end the immorality.
In the United States, we do not have any second thoughts about the idea that the Revolutionary War was moral. We think that it was perfectly legitimate for people to fight in order to gain their independence from a country that was oppressing them in a fairly mild way. If such a war is morally legitimate, a war to prevent slavery from continuing would be even more moral. The system of slavery was infinitely more oppressive than anything the British ever did to the American colonists. Slavery was a thoroughly immoral system in which a whole race of people were treated as if they were animals. They were made the property of people who had the power of life and death over them and could abuse them in any way they saw fit. This is surely one of the most immoral social systems ever to exist.
When one group of people is treating another badly, it is perfectly justifiable to confront those people with military force to force them to stop their abuses. Therefore, to the extent that the Civil War was fought to end slavery, it was morally justifiable.