A few points -
America will not seek or sign a formal alliance with Japan for the purposes of the war with Spain.
On the other hand, if Japan jumps in on the American side, America will have to politely put up with it, as long as Japan does not include territorial claims at odds with the Americans.
If the war begins with TR in the Navy and Dewey winning at Manila, that means that the Philippines (and soon Guam) are not going to be on the table for Japan to take. So the most valuable potential prize is gone.
Now Japan could do operations in, and claim, the rest of the Marianas, Carolines and Palau from a war with Spain. America would not really be in a position to strongly object.
It's hard to see those possessions alone being worth it, but then again, Spain is easy meat, and Tokyo could see this as their last chance to get any share of Pacific spoils, given the probability of American annexation of Hawaii and takeover of the Philippines.
The Germans have an interest in those island territories.
As LordKalvert said, there's always the risk of a multi-power European intervention against Japan, that Japan could not withstand.
On the other hand. If the Germans press the issue, they might find, to their chagrin, that they have no French or Russian diplomatic support. It's sort of obvious why France would not support Germany, but in the case of Russia, they had been irritated by Germany's 1897 move into Qingdao. They also have nothing to gain, for themselves, by taking Germany's side.
----If the Spanish-American war begins in the Caribbean without TR and Dewey arranging to be near Manila, then America will might tolerate any level of expansion in the Spanish Pacific that Japan seeks. However, taking the Philippines could be a bigger deal to Europeans than Micronesia, and the British or French or Russians might have enough reason to support the Germans in opposing Japan there. After all, there's enough islands that all the great powers could get some.
--SinghKing - by 1898 Japan was seen as both a trading partner and a potential threat in the United States. There was worry in America in the mid-1890s that Japan and the US might come to blows over Hawaii. The very first contingency planning against Japan took place in 1897. (It actually involved the main US fleet moving from the east coast through Suez to Singapore and Japan rather than via the Pacific- source, War Plan Orange, by Miller). Tensions over Hawaii aside, the US did not necessarily have objections at this time to Japanese aggrandizement in the *western* Pacific.