The end of Japan's isolation wasn't voluntary - Japan was forced out of its isolation by American gunboats sailing into Tokyo Bay.
Basically, they saw the world being divided into colonizers and the colonized, and decided they'd rather be the former. (Despite being theoretically closed to all outside contact before then, Japan did get some news from the outside, including descriptions of the Opium war in China.) Military modernization was a high priority from the beginning.
Without going into too much detail, in the late 19th/early 20th centuries, they colonized Korea and a few others, and jockeyed with America and European countries, including Russia, for influence in China. That was just how the international game was being played at that time.
Then they were hit especially hard by the Depression of the 30s. They depended a lot on export trade, much more so than America. Japan wasn't nearly as rich, either financially or in natural resources, so you can imagine how much worse off Japanese workers were when things hit the fan.
With the other developed countries putting up trade barriers to protect their own workers, Japan decided it was important to have a self sufficient economy, which meant controlling markets and natural resources in more of Asia.
As in Germany, hard conditions at home made foreign invasions an easy sell. Factions of the military stirred up old resentments against Japan's rivals, told the people that complete submission to a military regime was the only answer, and next thing you know it's WWII.
That's a lot of details omitted, but it's a pretty big subject :P.