Try thinking from Thailand point of view... Thailand was bullied by UK and France in the early 20th century and the only hope was to form an alliance with other countries. China was already broken into many pieces after the revolution and Japan was the only country that was strong in the East... Thailand had only two choices, either form an alliance with Japan or continue letting the western world to ripping Thailand apart... If you were the Thai ruler, what would you do?
You are correct that Japan have no choice but invade other countries to make itself stronger. Japan is a country formed by islands and even today there are no natural resources. That's why the Japanese invaded Korea once they were bored. Because China was weak and the new government was useless so Japan could invade the eastern Asia a lot easier. It's all the western world fault weakening China...