Hiroshima was identified as a potential atomic bomb target in May 1945, and deliberately kept off of the bombing lists. You can read the rationale here — basically it was a city with a large military base in it (not an industrial city) that would be very susceptible to the atomic bomb's blast effects for geographical reasons (it is in a sort of "bowl" of mountains), is the right size for the bomb to be very effective (it is basically the size of the blast radius, so total destruction), and because of its many rivers it was not considered a great conventional target (the rivers would act as firebreaks for a conventional attack).
So Hiroshima, Kyoto, Niigata, and Kokura were all kept from being bombed, because the US thought it was worth having an untouched target be the subject of the first attacks, to emphasize the power of the bombs. They were also chosen because the planners thought they could convince the USAAF not to bomb them into rubble ahead of time. (Another proposed city, Yokohama, was apparently rejected for this, and was firebombed shortly after this meeting.)
Nagasaki was never on the "do not bomb" list and was in fact bombed many times during the war. From the USAAF Combat Chronology:
8/10/44 Twentieth AF: 2 missions are flown during 10/11 Aug. In one, 24 B-29’s, out of Chengtu, bomb urban area of Nagasaki and 3 others hit T/Os. The B-29’s claim 1 ftr shot down, the first such claim (except probables) by the B-29’s.
7/29/45 FEAF: P-47’s from Ie Shima and B-24’s, B-25’s, and A-26’s from Okinawa pound tgts in the Japanese Home Islands. 70-plus B-24’s pound shipping at Kure. 41 B-24’s hit factory and storage area NW of Aburatsu, shipping and engine works in Nagasaki and vicinity... A-26’s pound naval base and engine works at Nagasaki.
7/31/45 FEAF: 80-plus B-24’s pound Kagoshima railroad yards and several other tgts in the general area including Sasebo naval base, Yaki-shima, and Nagasaki.A-26’s and B-25’s bomb Kanoya and Miyazaki A/Fs and nearby tgts, Sasebo naval base, Marushima, warehouses at Nagasaki, and a factory and power plant on Koyagi I.
8/1/45 FEAF: About 50 B-24’s bomb tgts in Nagasaki dock and harbor area. B-25’s and FBs in Nagasaki area hit docks, railroad yards, and shipping.
By comparison, other than the atomic bombings, Hiroshima only shows up in the Combat Chronology because they mined its harbor. Kyoto and Niigata do not show up at all, and Kokura only shows up because it was the primary target for the second strike. (Note that Nagasaki was conventionally bombed only about a week before the atomic bomb was dropped on it!)
So Nagasaki was unusual. The industrial targets that were claimed as the later reason for using the atomic bomb there were easily targetable by conventional forces (two factories, only one of which was the "real" target of the atomic bomb, but it missed its intended aiming point by so much that it happened to hit another factory also, so they claimed it was basically intentional later). The docks of the ports, and its warehouses, were targeted and bombed several times during the war.
The an interesting question to ask here is: so why did Nagasaki end up on the list of atomic targets, and when? The answer is that it was added to the list only on July 24, 1945, the day before they finalized the strike order with its targets, and was added there because the Secretary of War, Henry Stimson, pushed to get Kyoto removed from the list altogether. They wanted to have at least one backup target for every primary target, and removing Kyoto meant that not only were they down one target from their original four, but one of those targets (Niigata) was too far away from the other targets to be a reliable secondary (it would take too much fuel — a diagram). So removing Kyoto meant that they only had two viable targets (Hiroshima and Kokura), which would not be enough to have a secondary target for a second bomb. Nagasaki was added in the position of least priority and interest (it was pre-bombed, and was also not very favorable geographically — its valleys meant that the blast was considerably confined, and only destroyed half of the city), and was never put on the "do not bomb" list (which as you can see from the Combat Chronology did have consequences — three of those raids happened after it was put on the finalized atomic bomb target list). It was the secondary target for the second mission, but because there was smoke/haze/clouds over Kokura, Nagasaki became the target of the bombing.
One of the things that is at the core of your question: after the bombings, the people in charge of using the bombs (and those that would defend the bombings) were left with the burden of explaining to people why they thought it was necessary to destroy two cities and kill hundreds of thousands of civilians. And they chose to frame it as a question of ending the war, as well as emphasizing that the targets were "legitimate" targets of war — not merely civilians, but "military" targets. So they emphasized the aspects of those targets that made them seem important, like the Hiroshima army base or the two factories in Nagasaki. But this is somewhat of an after-the-fact and not-entirely-honest approach. While the targets were chosen because they had some "military" aspects to them (and indeed, this was, ultimately, why Truman agreed to remove Kyoto, because Stimson convinced him it was a "civilian" target, and that Hiroshima was a "military" target — this is a the subject of a much longer discussion though), they were mostly chosen because they thought that showing how terrible the bomb was would lead to a better appreciation of its "meaning" and power, and that might not only lead to a faster surrender, but a better postwar world as well. They tended not to emphasize these kinds of reasons after the war, because they sounded either like terrorism (violence and/or threats of violence as a means of enacting political results) or like a kind of utopian approach to destruction ("if we kill these cities, the rest of the world will accept the international control of nuclear weapons in the future, and save us from a world of future nuclear war"). But this leads very easily to not really understanding what the true motivations were, which leads to questions like yours, e.g. if these things were so important, why not just take them out earlier? The answer is: they weren't quite as important as all that, and they fit other criteria (mostly; again, Nagasaki is a weird addition) that they valued.