The Japanese feel that Western countries are unfair in imposing the status quo on Japan and calling it “peace.” Their whole conception of diplomatic machinery and collective security is that it is simply a means to maintain that sort of peace, and to that degree the Japanese people are against it. This doesn’t mean that Japan would not participate in collective security if some machinery can be devised which provides for “peaceful change.” … Japan has a legitimate desire to expand. What are the means by which a nation can legitimately expand? Imperialistic advances are apparently out of date, but this is not understood by the Japanese people. The average reasoning of the Japanese people is that Great Britain and the other Western powers have done it, so why shouldn’t we? The problem is not so much to determine the aggressor as to provide ample opportunities for the necessary expansion peacefully.17
Through the mid-1920s the Japanese were, generally, the most sympathetic of the imperialist powers to the Kuomintang in its attempt to unify China. In 1927, Chiang Kai-shek stated that the Japanese policy differed from the “oppressive” attitude of Britain and the United States, and Eugene Ch’en, then a high Kuomintang official, contrasted Japan’s nonparticipation in the imperialist bombardment of Nanking to the “cruelty inherent in the Western civilization”; this “indicated Japan’s friendship for China.” The goal of Japanese diplomacy was to strengthen the anti-Communist elements in the Kuomintang and, at the same time, to support the rule of the warlord Chang Tso-lin over an at least semi-independent Manchuria. At the time, this seemed not totally unreasonable, although the legal position of Japan was insecure and this policy was sure to come into conflict with Chinese nationalism. According to one authority:
Considering Chiang Kai-shek initial pro-Japanese sentiments, what led him to do a U-turn and decide to oust the Japanese instead of concentrating on the threat of communism?
In Nanjing, in April 1931, Chiang Kai-shek attended a national leadership conference with Zhang Xueliang and General Ma Fuxiang, in which Chiang and Zhang dauntlessly upheld that Manchuria was part of China in the face of the Japanese invasion. After the Japanese invasion of Manchuria in 1931, Chiang resigned as Chairman of the National Government. He returned shortly afterwards, adopting the slogan "first internal pacification, then external resistance". However, this policy of avoiding a frontal war against the Japanese was widely unpopular. In 1932, while Chiang was seeking first to defeat the Communists, Japan launched an advance on Shanghai and bombarded Nanjing.
I couldn't find why Chiang suddenly decided that the Japanese occupation of Manchuria was unacceptable. He initially saw Communism as a bigger threat and considered the Japanese to have a legitimate desire to expand its sphere of influence, and yet Chiang decided to combat the Japanese and join forces with the West and the CCP.