I don't understand this distinction between actual and official reasons. What, are there conspiracy theories out there saying we did it to test the bomb on actual people?
Anyway, the point is that the principle behind the bombing of Japan can apply to bombing Iran. Japan, a proven threat, was given an ultimatum to surrender unconditionally, which it refused. The Japanese were going to fight to the death, to be 'martyrs', were we to invade. In response, the most efficient, least costly method of taking down the threat was to use nukes. Similarly, we have Iran, the heart of an Islamic culture that glorifies martyrdom, as a proven threat. Iran should be given an ultimatum: surrender unconditionally or be bombed.
I agree with you that Iran has not committed the same injustices on the same scale as Japan. But the difference exists only because Japan was allowed to act out its ambitions, while Iran can't just yet. In principle, however, their ambitions are the same: world domination using a militant flavor of religious fanaticism. And so, in principle, the same solution applies: give up or die.
As far as your second point, I think it's more of a tactical question, not a moral question. We must agree, however, that the most efficient, least costly option that results in the end of the threat is the moral option. If not, we can't discuss this issue. (That is, we can't discuss "containment" for the sake of preserving "economies".)
If we have good cause to suspect that bombing of Iran would induce retaliation by it or other parties, then we cripple all capabilities for retaliation in one truly shocking and awing strike. Additionally, we may beforehand deliver an ultimatum to those who would be insane enough to think of such a notion: you make a single move toward such an act, you will be destroyed.
It is truly a tragedy that non-freedom-loving nations were allowed to get the bomb. It is an indictment of our foreign policy. Fortunately it seems this policy is changing.
Let me add that this is all moot anyway, since there is no way in hell a military guided by Just War Theory will ever act in a wholy selfish way by using nukes to break the will of the enemy.