Were these cities crucial to weapon development, financial resources, to get the most casualties, or for other reasons?
You can find other discussions on here in linked to in the FAQ about this, but the criteria for targets were urban areas as of yet not significantly bombed conventionally, ideally with some kind of war plant or military facility within them that could be used as the official justification for attacking it. But it was very clear that the goal was to make "sufficiently spectacular" display of destroying a city first and foremost — the atomic bombs were meant to be psychological weapons primarily, showcasing a new and terrible power.
The original military choice for targets was Kyoto, Hiroshima, Kokura, and Niigata. Kyoto was nixed because the Secretary of War, Henry Stimson, wanted it off the list (the exact reasons are not exactly clear, but it was some mixture of sentiment and strategy). Truman participated in this decision (the only real "decision" he played a role in regarding the use of the atomic bomb). Hiroshima thus became the top choice because of its topography, the fact that it had a military base in it, and the fact it was not known to have a major POW camp in it. It was pretty much the exact right size and topography if you wanted to destroy a single city with the atomic bombs of World War II.
Removing Kyoto from the list meant they needed another target, so Nagasaki was added to the list, but it was the lowest-priority of the targets on it (though higher in practice than Niigata because of its proximity to Kokura and Hiroshima). The second atomic bombing run was against the second-highest priority target, Kokura, a military arsenal surrounded by workers' housing. When the bomber arrived at Kokura it found it obscured by smoke/clouds/haze, and so Nagasaki, the backup target for that mission, was chosen instead. It was in many ways a much more inferior target from a military perspective and the mission was somewhat botched, but they managed to destroy about half of the city anyway.
There is more that one can say about this topic but that is a very brief overview. To get more insight into their target criteria, I find the meeting notes of the second Target Committee meeting from May 1945 a very provocative and important document. It's not the only document that outlines their thoughts but it's a good place to start.
The big take-away that I always try to impress upon people as the bottom line is that their goal was to shock and awe through mass destruction, with the hope that this would have a massive psychological impact on the Japanese and, to a degree, the rest of the world. Everything else was secondary to that. Much has been written about the value of Hiroshima or Nagasaki to the enemy, but that is not why they were chosen.