Wtf were they thinking or are there some nuanced undercurrents that allowed this to happen?
Japan wanted to expand its empire in East Asia, but the Philippines were a U.S. colony at the time and so Japan risked running afoul of U.S. interests. Japan thought that they could deliver a devastating attack to the U.S. and then, from a position of strength, negotiate terms favorable to Japan.