No question that they were necessary and proper. One might argue over whether they could have been used on a military target but I don’t know the logistics.
There were legitimate military/industrial targets at both Hiroshima and Nagasaki