The UK and France declare war on Germany in 1939 after Germany invades Poland. This was in response to a couple of years of German territorial aggression which included the annexation of Austria and part of Czechoslovakia. Their war declaration had nothing to do with Nazi treatment of Jewish people and everything to do with the fact that the UK and France were allied with Poland. The USSR enters the war in 1941 after Germany invades it. The US enters the war after Germany declares war on the US on December 11, 1941.
So none of the main players of the war were pulled in by some righteous idea of saving the Jewish people and ending the Holocaust.
In the mid-to-late 30s, the oppression began to be seen and there's a wave of Jewish immigration. But the US and UK both had issues taking massive numbers of refugees and many were turned away. Jewish groups in the US lobbyed Roosevelt to do more. But his hands were tied by legislation, like the immigration act of 1924 limiting refugees, and while he arguably could have done more to push the issue, he didn't.
By January 1942, there are reports showing both the UK and US governments were aware of mass executions going on in Poland. The American press picked up on the stories, but the government wouldn't confirm. Throughout 1942, we basically see more and more evidence coming out of Poland and the US and UK government ducking the issue. At least part of the US hesitation was that the main reports were coming from the Polish government-in-exile and some believed that the Polish government was exaggerating the situation to get the US and UK to speed up their assistance.
What is clear is that by December 1942, the governments finally publically acknowledged the Holocaust with the Joint Declaration by Members of the United Nations. It condemned the Holocaust and stated that the perpetrators would be held as war criminals.
Nevertheless, ending the war was the primary objective for the Allies. Churchville reportedly was in favor of bombing the rail lines leading into Auschwitz, but the plan was rejected as it didn't directly address the war effort. FDR's idea was that ending the war as quickly as possible was the best way to end the Holocaust.
Now, despite the Joint Declaration and reports about what was happening, it's clear that Allied soldiers on the ground were either not as knowledgeable about the entire situation or that the reality was simply way worse than they could have comprehended. Numerous reports of soldiers on the ground describe the conditions of the camps they came across (its at this point, anecdotal rules aside, I always mention that my grandfather was one of the US soldiers who liberated a concentration camp and that the horror of that situation lead to post traumatic stress and a drinking problem that killed him, he didn't share the story with anyone until his death bed). Even Eisenhower was overwhelmed by the situation on the ground. He ordered the army to photograph and document was was being found because he didn't think anyone would believe it without seeing it and was afraid people would eventually try to downplay how horrible it was. Yeah - in 1944, Eisenhower already predicted that there would be Holocaust deniers. So it's fair to say that soldiers on the ground weren't incredibly informed and likely it wasn't the individual motivation for your average soldier. Certainly for some more knowledgeable about what was going on, that was their reason to fight. But any attempt at individual motivation is more speculation than fact. There's thousands of stories out there from soldiers in the war with their own motivation for being there.
The answer to "why" - well basically the US and UK didn't think framing the war in context of saving the Jewish people would be popular to help gain support. There was concern that anti-semitism could hurt the war effort. So even though it was acknowledged, it was never hyped.
There's also a story that basically goes that in 1944, the war is going poorly for Germany and Hitler orders the Jews in Hungary to be sent off to concentration camps. Adolf Eichmann, who was in command of the SS and Jewish affairs in Hungary, tried to broker a deal with the UK to exchange a million Jewish people for 10,000 trucks and other goods and supplies with a promise that they would be used on the eastern front. The "blood for goods" deal as it is known was rejected. Now it's not clear how true or genuine any of this story or offer was. Meaning the offer was made, but it isn't clear exactly how genuine the offer was or why exactly it was rejected. Some suggest Eichmann was reaching out and trying to feel out the UK to eventually broker some sort of surrender apart from Hitler Some thought it was a smokescreen orchestrated by Himmler (if a million Jews were turned lose to head towards Allied lines, it would disrupt military operations and essentially turn them into human shields). Some report that the British response was callously "where would we put a million people?" - British newspapers would call the story "loathsome" and an attempt at blackmailing and deceiving and splitting the Allies. Churchill put an end to it stating the extermination of the Jews was "probably the greatest and most horrible crime ever committed", and that there would be "no negotiations of any kind on this subject."
So to answer the question - the Holocaust wasn't why any of the Allies fought in the war and it wasn't until late 1942 that they even acknowledged it. The primary goal was ending the war which meant a total capitulation of Germany. The secondary effect of that would be ending the Holocaust. Ultimately they couldn't do one without the other, but by the time everyone acknowledged the Holocaust, they were already all in the war and on that path anyway. The Holocaust didn't necessarily change any of the Allies plans. Churchill was the most outspoken Allied leader about his support for the Jewish people - but Churchill was also the most outspoken Allied leader period.
But, just also to note, it certainly wasn't unimportant as numerous Nazi officials were later tried for war crimes due to their part in the Holocaust and it wasn't taken lightly by the Nuremberg court. The Allies did liberate the camps and provide medical care and assistance for the survivors, so they weren't some ignored objective. But I think it's fair to say that ending the Holocaust wasn't ever the main objective, rather it was an objective that became inextricably intertwined with the main objective of capitulating Germany.