Were those two cities chosen for any strategic or tactical reason?
There were initially five cities chosen to be targets for the atomic bombs, in order of importance: Kyoto, Hiroshima, Yokohama, Kokura, Niigata.
Kyoto was ruled out early on by Secretary of War Henry Stimson because of it's historic and cultural significance. Stimson had visited the city when he was Governor-General to the Philippines. Truman concurred, apparently because the city lacked military significance.
Hiroshima contained the headquarters of 2nd Army, in charge of the defense of southern Japan. It was also a major army depot and a large port. The hills around the city would both contain and amplify the blast. Because of the rivers, it wasn't considered as suitable for incendiary bombing.
Yokohama was a large industrial area with aircraft manufacturing, oil refineries, and other industries. Furthermore, some production had moved from heavily-bombed Tokyo to Yokohama. But the industry was spread throughout the city, making it a less attractive target from the first two. It also had a heavier concentration of anti-aircraft.
Kokura Arsenal was one of the largest arsenals in Japan.
Niigata was a large port, becoming more important as other ports were damaged. It also had some oil refineries and storage.
Summary of Target Committee Meetings, May 10 and 11, 1945, Memorandum from Major J. A. Derry and Dr. N. F. Ramsey to General L. R. Groves
Nagasaki was added to the list after Kyoto was removed. It was one of the largest ports and contained Mitsubishi's large manufacturing facilities as well as others. Furthermore, the industry was more concentrated than Yokohama's.
With the removal of Kyoto, Hiroshima became the prime target. Kokura was chosen for the second mission's primary target, but due to haze or smoke obscuring the target, Bock's Car diverted to Nagasaki.
Hi! not discouraging more discussion here, but FYI we have a couple of threads in the FAQ that can get you started. See /u/restricteddata's comments here:
edit: and some more comments on other targets that were considered
If you have follow-up questions on archived posts, just ask them here