Iran would make allies in Iraq, Afghanistan, and Pakistan, by supporting anti-US forces (they already do that). It would put a strain on US relations with other middle eastern states like egypt and saudi arabia, they will be mad at us but won't side with Iran; oil prices would skyrocket, at least temporarily. Russia and (possibly China) would probably help the Iranians covertly (if not by government action, then by organized crime, smuggling etc). US allies in europe will try to stay out of the war, but they might face ground attacks.
As far as attacking Iran on the ground, they have a lot more supplies than Iraq did, so the insurgent fighting would be more deadly for US forces. Iran would pool it's resources towards trying to complete a nuclear bomb, and unless we stopped them from achieving that, the war would basically end. Iran would rebuild from our airstrikes, now posessing a nuclear weapon, and with US influence in the middle east greatly reduced.
Most countries in the world don't like Israel, that's why the US would lose all of its middle eastern allies if it attacked Iran to protect Israel. Strategically, Israel does not deserve our protection, but pro-Israel lobbyists have a lot of power in American politics, maybe enough to drive us to a disastrous war.