As I understand it, the Japanese put up incredible resistance on Okinawa so that the Ameiricans would believe it would be too costly to invade the mainland. This would allow them to sue for better peace terms.
They were right about the Americans believing that the cost of invasion would be very high (and maybe it would have been) and therefore, the decision to drop the atomic bombs was make easier for the Americans.
I am not so sure that at the time the decision was all that difficult. I asked my Dad if there was much moralizing about dropping the bombs right after it happened. His answer was simple. No.
My only brother was killed on Okinawa and I was in a line as a replacement on Leyte getting my new battle gear for the invasion of Japan which we knew was coming. Great relief when a Lt. came out and told us to go back to the tents as the war was over. It didn’t hurt my feelings then, nor now, that the bombs were dropped, only wish it had been sooner to avoid the deaths on Okinawa.