"At all costs" is a red herring. The first question is: does the Constitution grant the right to deal with insurrections. The answer is yes.
The next question is: should the Federal Government have dealt with the secessionists, or should it have let them go?
That's less clear; however, U.S. history leading up to the war indicates that a war between North and South was probably inevitable. The bloodshed in Kansas is a case in point. It is very likely that the British would have supported an independent South in such a war, and it's also likely that the North would have been at a disadvantage had secession been allowed to occur.
By those lights, one can make a reasonable case that the North acted to define the terms of an inevitable battle.