I truly hate the historical revisionism of Westerners. Japan engaged in colonialism because it was an active victim of colonialism, and the only way to fight back was to stand on equal footing. Through the 1800s~1940s, Europe controlled nearly the entirety of Asia. China had been subject to countless treaties forced upon it. The Philippines, Indonesia, Malaysia, Vietnam, Cambodia, Burma, India were all colonies. 90% of Africa was under European control. 100% of both Americas was under European control. 100% of Australia and New Zealand was under European control. Europeans were literally aiming for world domination. The list of countries free from European colonialism could be counted on one hand: Japan (only because it successfully fought back), Korea (before it got annexed by Japan), Siam, Nepal, Iran pretty much covers it. Yet amazingly Europeans found and continue to find no shortage of pearl clutching over Japan daring to do the same thing they did, in a dog-eat-dog world where not doing so meant becoming another pawn.
To the extent colonialism declined, it was solely due to to the world wars wrecking Europe so utterly they could not maintain their overseas holdings, + the untouched US intervening in eg. Suez Crisis in order to assert itself as the global Western hegemon with no peers.