There is oil in the eastern parts of Russia and also plenty of minerals. Japan needed both of them, as they were being embargoed by the Americans and the British. Surely it would have made more sense for them to try to try to get resources from there and fight vs the Soviets, who were already engaged and loosing in the west rather than go against the US, right?
The Japanese and the Soviets had clashed as recently as 1939, with a decisive Soviet victory at Khalkhin Gol. This influenced the Japanese high command to postpone any potential anti-Soviet push, though they kept it as a potential option. The most opportune time for them to have potentially declared war was when the Soviets were on the verge of collapse to the Germans, but at that point the Japanese were far too involved in securing their holdings in the Pacific and South Asia and they instead reaffirmed their neutrality with the USSR.
The elaborate diplomatic dance between the Soviets and the Japanese is one of the fascinating, lesser-known aspects of World War II that ended up having tremendous consequences over the course of the war and especially at the end of the war. I found Hasegawa's take on it in Racing the Enemy: Truman, Stalin, and the Surrender of Japan a good read.