Yes it was. And out of the bloodshed of the Revolution was created a country that even with all it's faults is still a beacon of light in the world today. Lincoln was aware of that legacy and did what he had to to prevent the South from ripping that country apart.
The “End” does not justify the means.