When Nazi Germany declared war on Poland in 1939 the UK and France joind the war in defense of Poland. Days later the USSR Declared war aswell. That raises the question in the title.
More of course can be said, but this previous answer may be of interest for you.
The short answer is that Britain's Aug 25 pledge of "all the support and assistance in its power" explicitly didn't extend to defending Poland against the USSR: a secret protocol to the alliance specified that "By the expression 'a European Power' employed in the Agreement is to be understood Germany".
British policy was governed not just by the impracticality of waging war against both Germany and the USSR ("We don't want to go about the whole world today finding enemies and declaring war on them," as Tory MP Robert Boothby put it), but also by Whitehall distaste for a generous 1921 Polish eastern frontier that the WW1 Allies had taken two years to recognise. The eventual new Soviet western border of 1939 largely followed that proposed by London itself twenty years earlier.
btw, Note that the USSR didn't declare war. Its position was that rather than entering into hostilities it was merely "taking under its protection" the territories lost to Poland in 1920, the Polish state having in its view "virtually ceased to exist" in the fortnight since the German invasion.
Follow up question: how the heck did USSR get away with annexing so much of Poland and keeping it after the war?