We were asked the very same question in my history class, it seems that the americans wanted to "test" there weapon on a heavily populated area so that why they set it off over hiroshima and nagasaki the government was trying to end the war the scientists were conducting tests. So i would say it was wrong to use the weapon on those cities but if the weapon wasnt used the war would probably continued for a long time and many of the countries that are free today may be part of japan.
short answers :
No the weapon shouldnt have been used on civilians
Yes the weapon should have been used to end the war