The reason why the nuclear facilities of Iran were attacked is because Israel the US and for that matter most of the world do not want the Ayhatolas to have nuclear missiles.
If not, they would attack the oild, the roads or whatever, but instead of that the attacks hitted (mainly) military targets and nuclear development facilities.