Hong Kong is an excellent harbour and while land based it was also seen as excellent to defend for the naval power of England. But these strategic basics only explain the smaller part of the story. If taken for granted and without further explanation it represents a post-hoc reasoning, that illustrates why hindsight sometimes is the opposite of 20/20 as in this case this reductionist view blurs out too much of the details.
This is partially some kind of path-dependency as well as contingency. The British were already present in Canton (Guangzhou) before that Opium War. Meaning that they had permanent trading posts and local connections since 1711. Their treatment there was one of the reasons why they wanted to "normalise" the British-Chinese relations, that is: force what they saw as their rights by gunship.
And after that war was over they merely consolidated their position there. Initially there were clear instructions to build the base from spoils of the war in Zhoushan which has striking similarities in characteristics compared to Hong Kong and was located much closer to Beijing. Choosing Hong Kong was therefore just a small step up for their previous position whereas other ports would mean thinning of forces if taken in addition and starting from scratch if chosen instead of Hong Kong.
In rephrasing @sofa-general's comment: Hong Kong itself was not a great port at the time, just a natural harbour. The other treaty ports were all large towns and fully developed and land-based at the time. Thus, additional reasons that played a role are the comparatively underdeveloped status and therefore 'worth' of that piece of land for the Chinese ("an inconsequential fishing village"), close to Canton (a major port), and far from the imperial capital of Beijing, and thus something the Chinese would not see as such a big threat, loss of face, and perhaps did not mind ceding as much as a bigger established port, closer to the capital.
It might be argued that in any negotiations the objective prospective value for the British gaining it was high, while the immediate value loss for the Chinese was relatively low.
The course of the war also made sure that the British presence that was once in Canton now made itself at home on the island and fortified it before the war was over, negotiating to purchase in a preliminary treaty, that didn't satisfy anyone. This faît accompli is in sharp contrast to much less favourable conditions to be found in other potential bases for the Britsh.
During the second half of December written negotiations were going on between Elliot and Ch'i-shan without any result. Elliot was still sticking to the general demands outlined in Palmerston's letter, only made more concrete by the substitution of 'Hongkong' for Palmerston's 'large and properly situated island'. Warlike measures were decided upon, and on January 7th Lin records in his diary: 'A fine day. The English attacked the forts at Shakok and Taikok.'
Arthur Waley. "The Opium War through Chinese Eyes", Routledge: London, New York, 1958. (p130)
When the British demonstrated their naval prowess in Bohai, which was just over a hundred miles from the imperial capital of Beijing, the Court was shocked and a senior official, Qi Shan (or Keshen as he was known to the British), was tasked to persuade the British to retire to the southern city of Canton and negotiate there. With Qi replacing Lin as Special Commissioner in Canton, negotiations dragged on through the autumn of 1840. The British again forced Qi to come to an agreement after a further display of naval superiority. Qi had no choice and reached a tentative agreement with Charles Elliot, known as the Chuenpi Convention.
By this agreement, the island of Hong Kong was to be ceded to the British; an indemnity of six million silver dollars was to be paid over six years; official relations between the two empires was to be direct and on equal footing and trade was to be reopened immediately. As a result, the British took possession of Hong Kong and British rule began on 26 January 1841.
Elliot had chosen Hong Kong rather than Zhoushan as instructed by Palmerston, because he had reservations about opening more ports in China. In his judgement, more ports would only create more opportunities for the scattered British communities to be taken hostage, whereas the excellent harbour of Hong Kong had proved itself a valuable base to support the British trading community in Canton.
London was determined to get what it wanted by war. The thinking was that if British forces could occupy strategic points that would allow them ‘to control the internal commerce of the Chinese empire’ they could exert ‘pressure upon the Court of Pekin irresistible’.49 Once the forces were in place and ready in Hong Kong in September 1841, Pottinger started a series of campaigns in the lower Yangtze region, eventually fighting their way up this mighty river to threaten the city of Nanjing (Nanking) almost a year later. By then the British had already taken control of the key points in the lower reaches of the Yangtze, the most important waterway for commerce and communications in the richest part of China. They had also cut off the Grand Canal, historically the designated channel for the transport of tribute-grain from the south and the east to the imperial capital.
With repeated demonstrations of British naval and military superiority, as well as great mobility, the Court in Beijing had to take into account the implied threat that the British forces could swiftly redeploy to threaten the Beijing-Tianjin area once they had stormed Nanjing. This left the Chinese with little choice but to make peace, a task that fell on Yilibu (Elepoo to the British) and Qi Ying, two new Special Commissioners. The result of the negotiations was the Treaty of Nanking, which was signed by the plenipotentiaries of both sides on board the 72-gun HMS Cornwallis in Nanjing on 29 August 1842. Ratification was exchanged in Hong Kong on 26 June 1843, an act that formally allowed Hong Kong to be created a Crown Colony. (p10–13)
Steve Tsang: "A Modern History of Hong Kong", I.B.Tauris: London, New York, 2004.
Take note that from top to down the decision was almost made up by underlings present at the location. Not everyone was indeed happy back home with it at the time:
Conclusion: Report on Hong Kong, showing its utter worthlessness to
England in every point of view, and the necessity of reducing our
Robert Montgomery Martin: "China; political, commercial, and social; an official report", 1847. (p317) (archive.org)
From a slightly different narrative, starting years before the actual war:
Before he arrived in Canton, Elliot sent word ahead to all British ships docked at the city to sail to the relative safety of Hong Kong. As the new Superintendent, in full dress uniform, sailed up the Canton River en route to the factories, to speed his trip he transferred to a small rowboat. The inauspicious craft, flying the Union Jack, landed near the factories on March 24, 1839, three days past Lin’s deadline. (p47)
On the same day that Lin began tearing down the factories in Canton, eighty miles southeast in Hong Kong, a drunken melee ended in tragedy and raised the simmering tension between the Chinese and Europeans to the boiling point.
At this time, Hong Kong was not a city, but a collection of sleepy fishing villages and a few coves used by pirates. As the typhoon season approached in mid summer, opium-carrying ships in Macao sailed forty miles northeast to Hong Kong’s harbor, which provided better protection. There, at the end of June, soldiers aboard a Chinese warship arrested the comprador of the British ship the Carnatic. Enraged sailors on the Carnatic demanded the comprador’s return, but their captain hesitated to inflame an already incendiary situation with violence. The sailors seethed and plotted revenge. It was only a matter of time before the resentment boiled over into action. On July 12, 1839, thirty seamen from the Carnatic and the Mangalore, both owned by Jardine, Matheson & Co., went ashore, joined by colleagues from other British and American ships. At the village of Jianshazui on the Kowloon peninsula north of Hong Kong island, the sailors got hold of a fortified rice wine called samshu, with which they proceeded to get blind drunk. Letting out steam after being cooped up in their ships for so long, the men turned into belligerent vandals, destroying a temple and fighting with the locals, one of whom, Lin Weixi, died a day later after a severe beating by the sailors.
The Commissioner decided to expel the refugees from their new sanctuary in Hong Kong by cutting off their water supplies. There were now seventy British ships with several thousand aboard in Hong Kong’s harbor, and the mass of refugees was growing restless, for good reason. Elliot, also in Hong Kong, suspected that men aboard three Chinese warships in the harbor had been poisoning wells and stopping food from arriving. He sent three ships, the Louisa, the Volage, and the Pearl, to attack the Chinese warships that patrolled the harbor. (p65)
With the Emperor’s sacrosanct capital threatened and deprived of its food source and revenue, the British merchants envisioned quick victory followed by a generous peace settlement. Not as hawkish as the traders on the scene, however, Palmerston had balked at Jardine’s demand for major involvement and instead approved a partial blockade of the coastline and the commitment of a few hundred soldiers instead of the thousands Jardine had suggested. Palmerston’s “diplomacy by other means” was at present more diplomatic than belligerent. The move against China would be incremental, rather than overwhelming from the start.
The British Admiralty’s Sir John Barrow dismissed Jardine’s counsel out of hand. He believed that threatening the Chinese capital would make its residents and ruler dig in to defend their last bastion rather than bring them to the negotiating table. Barrow wanted military efforts to center around the Gulf of Canton, shelling the city and seizing nearby Hong Kong. Elliot recommended a middle ground: take Canton, then with their rear protected, the British could proceed to the Bei He River and threaten the capital. (p88)
While the Chinese feted Elliot’s men with wine and mutton, and the British entertained their “hosts” with a musket drill that was part show, part threat, Qishan and Elliot conferred aboard a boat in the middle of the Canton River. By January 20, 1841, they had agreed to what would be known as the Chuanbi Convention. In light of the annihilation of the Chinese forces, the British were surprisingly magnanimous about the terms, which in the hands of a more vengeful power could easily have devolved into a diktat. The British agreed to buy Hong Kong for $6 million, ambassadors at last would be exchanged, all contact between the two powers would be direct and official, there would be no more linguistic squabbling about “tribute-bearing barbarians,” and trade would resume. The British also agreed to return the forts they had captured, including all of Chusan Island. To pay for the war and save Palmerston from a budget battle in Parliament that might cause the government to fall, the Chinese were forced to pay $6 million, neatly neutralizing their gain from the sale of Hong Kong. Qishan presumed that the Emperor and his court would agree to the indemnity because they planned to extort the sum from the Hong merchants, which they in fact did. (Howqua alone coughed up the enormous sum of $820,000 as his contribution to the indemnity.) Far from home and burdened by slow communication, Elliot couldn’t know that the Chuanbi pact would infuriate Palmerston, who still wanted the instructions he had given Elliot followed, namely reimbursement for thetwenty thousand confiscated opium chests and the cost of the war. The Emperor was even more outraged, especially by the cession of Hong Kong, and recalled Qishan to Peking. Impotently, the Emperor, still operating in an alternate universe, however celestial, also ordered Elliot to report immediately to the capital for his execution.
Palmerston was as displeased as the Emperor, although British civil servants were not so ruinously punished. When the Foreign Minister learned the terms of the Chuanbi settlement, he complained, “After all, our naval power is so strong that we can tell the Emperor what we mean to hold, rather than that he should say what he would cede.” The repatriation of the hard-fought-for Chusan particularly irritated Palmerston because he wanted a strong British presence near the mouth of the strategic Yangtze River, which Chusan provided. Palmerston also at last put the ugly source of all the hostilities on the table when he insisted on the “admission of opium into China as an article of lawful commerce.” Elliot, the anti-drug advocate, had not even brought the subject up during his meetings with Qishan. Palmerston was also displeased with the $6 million indemnity, wanting more for the trouble the Chinese had put his invading troops to. And he wanted more ports open to British ships. When Elliot finally received Palmerston’s written response to the Chuanbi Convention, the news was not good. The British government would not ratify the agreement.
On January 20, 1841, the same day that the Chuanbi Convention was signed, the Emperor ordered Qishan to stop negotiating with the barbarians because military reinforcements were being sent to Canton from the interior. Thousands of troops would be under the command of a geriatric commander whose days of military glory were far behind him. The seventy-year-old Yang Fang was an unlikely choice for generalissimo and China’s last hope of wrestling sovereignty back from the encroaching British. Yang was stone deaf and gave orders to his men in writing. On the diplomatic front, the Emperor enlisted a cousin, Yishan, who also made his way from the capital to Canton. (p120)
Despite its barrenness, Hong Kong was a brilliant new jewel in Her Majesty’s crown because of its deep harbor and a native population too small to oppose their new British masters. (The British were happy to let go of dangerous Chusan, where Captain Stead of the troopship Pestonjee, unaware that the Chuanbi Convention had ceded the island back to the Chinese, was disemboweled by the locals after landing there.) (p122)
W. Travis Hanes & Frank Sanello: "The Opium Wars. The Addiction of One Empire and the Corruption of Another", Sourcebooks: Naperville, 2002.