It was bad militaryily because they could have never won a war against the United States, and they knew that. Even if they did knock out our Carriers, if they were there. We still would have beaten them.
If they wanted oil, they could have invaded Russia, while they were busy with the Nazis.
By the way, the problem was not the fact that it was a suprise attack but that they were talking peace to us, while they plotted for war.