If the Union lost the war Lincoln would have let the slave states rejoin the union without ending slavery. But why, what would have been so bad about the slave states keeping to their own confederacy. Why was keeping the Union together more important than ending slavery when slavery was the reason they were at war in the first place.
Lincoln would have done no such thing because he would not have been asked to. The point of secession was to forever free the major enslaving states from the dangers of a Union with the free states to the preservation of slavery. There were certainly enslavers up to and after the votes for treason who believed that the Union could still be worked to their benefit, and the whole history of the United States suggests that they might have been right, but their opponents in the enslaving states certainly had it right that the antislavery movement had grown tremendously in power and influence during the last antebellum decade. Once the decision was made, most of them devoted themselves fairly seriously to the product of a new empire for slavery and it's very hard to imagine any situation short of complete military defeat where they would have sought any kind of readmittance to the United States. Which leaves the meat of your question. Let's take that in two parts:
Why did Lincoln Say preserving the Union was more important than ending slavery?
There are a bunch of reasons here. Early on, the most important one is that about half the enslaving states haven't voted to commit treason in defense of slavery. Until Sumter, Lincoln is very concerned about keeping them loyal. One of them, Maryland, is between the capital and the rest of the country. The states of the Upper South in general also include most of the region's population and industrial capacity, not the kind of thing you want to give away if it comes to a shooting war. It's important to him to avoid the appearance of a war on slavery that might drive out not just North Carolina and Tennessee, but also everywhere south of the Mason-Dixon and the Ohio River. When push came to shove he took a gamble and dared the Confederates to fire the first shot. They did. (Several times, in fact.) He could then argue correctly that they had made war upon the United States.
The argument didn't convince everyone, but Delaware, Maryland, Kentucky, and Missouri opted out of treason. Had he called for volunteers to destroy the scourge of slavery, it's unlikely he'd have kept all four of them in the loyal column. Secondly, if Lincoln called for volunteers to wage a war to destroy slavery in the United States it's unlikely he'd have found even many free states eager to supply men. It's one thing to oppose slavery through ordinary political means but quite another to be on board for a war specifically all about it. Nor would declaring such a war have made it easy to convince the traitor states to accept a loss and some kind of readmission with their system of slavery intact...which was the expectation early on. A few decisive battles and calmer heads in the South would take over and call the whole thing off. Lincoln did not want a revolutionary war to destroy the institution and had for his entire life advocated a gradual end to slavery, with which this is entirely consistent. At some future date, states would pass or the feds would induce them to pass laws that would free every child of an enslaved person born after a certain date but requiring them to work for their parents' owner until they reached a certain age. It might take a century or more to get there, but this was how slavery ended in the North and it seemed like a reasonable, exceptionally moderate way forward.
Which brings us to the second half of your question: Why would Lincoln say that saving the Union is more important than ending slavery?
The simplest answer, which is also correct, is that that's what he genuinely believed. Lincoln was not lying about his priorities, but we must also consider those statements in light of his and other antislavery whites' longstanding beliefs about how slavery would end. The Union was, to them, a system by which gradual emancipation could be facilitated. Continuing to add more free states in the American West would reduce the relative power of the slave states in the Union and make possible various other indirect attacks upon slavery. This might in time come to a Constitutional amendment for abolition, which might be coupled with some kind of federal appropriation to buy enslaved people their freedom and most probably also to deport them from the United States whether they wanted to go or not. So when Lincoln says that he's for preserving the Union, he doesn't view that as contradicting his desire to see slavery slowly end. This all makes him a thoroughly conventional antislavery man.
Those two goals overlap substantially, but it's also true that they are not necessarily identical and only become so over the course of the war. For Lincoln and most antislavery whites, the primary aim of the war is not to free a single enslaved person even though keeping them enslaved is the entire purpose of the traitor movement. To 19th century Americans, the Union is synonymous with democracy itself. They are keenly aware, often to the point of paranoia, that theirs is the only enduring republic in a world full of kings and emperors who seem to have the rising tide of history behind them. The United States, for all the bluster of the era, is a large and weak country understandably wary of the great powers of the age. If it were to lose a large chunk of its population, territory, and wealth then it would be far easier prey for European powers who might have designs upon it. Letting the South just bail would have crippled the American experiment, likely fatally, in the face of foreign foes.
And foreign foes are only half the story. The rebels did not commit their treason in response to anything Lincoln did. Half of the traitor states did their treason before he even assumed office. Rather their grievance constituted losing an election contested fairly by every standard of the era. The whole point of holding elections is deciding who gets to govern and if the immediate reaction to the other side winning is to quit the system, then one has not actually accepted the principle of government by consent and the preferred system revealed by that action is one where the election is essentially meaningless because its outcome must always be to one's liking in order to be tolerated. Should Lincoln permit that one to fly, then it would be a certainty that within a short while some state or collection of states would find something done by the government through the normal process of majority rule odious enough to threaten to bolt. Then the government must either acquiesce or be further dismembered. In short order every interested party would demand an absolute veto on all national actions and the nation would collapse under the weight of its internal contradictions, most likely into some sort of regional collections which would not be nearly so foolish as to tolerate such a nonsense system of designed-to-fail non-government and prepared to prosecute their conviction on that point by force...just as the United States did. Certainly whatever emerged from the ruin would do so, or it would itself cease to exist in very short order.