This is an interesting question to ponder. The answer has a lot to do with the type of story that this is. It is a juvenile adventure story, which was a flourishing genre in this particular literary period, and was generally aimed at boys. A famous example is The Coral Island by R M Ballantyne (1858) which, similar to Stevenson's story involves a group of boys on a far-away island.
These stories generally involve a deliberate removal from everyday life and concerns to far-flung places of high adventure, just as Jim leaves his home and family and finds himself caught up with bloodthirsty pirates and strange castaways and hidden treasure. This was also the period of high British imperialism and generally there was a lot of interest in depicting the far-away exotic places that were then under Britain’s control. The adventure fiction tradition taps into this, although Treasure Island is not concerned with imperialist adventure as such.
These stories, then, feature almost exclusively male characters, deliberately opposed to the kind of more domestic and homely stories which were seen to be the female domain. Girls in stories of this period were more passive, and more concerned with home and family. The boys’ adventure novel could be seen as a kind of reaction to this.
Excitement is the keynote of juvenile adventure fiction. Although Jim loses his father early on and has to leave his mother, he does not seem to feel any sadness at all when setting off on his voyage.
And I was going to sea myself; to sea in a schooner, with a piping boatswain, and pigtailed singing seamen; to sea, bound for an unknown island, and to seek for buried treasures! (chapter 7)
Jim, then, is in a state of high excitement, looking eagerly forward to the glamour and mystery of voyaging to an 'unknown island' and seeking 'buried treasures'. His old life with his parents in the inn might have been safe and secure, but relatively dull.
Treasure Island, like other stories in the adventure tradition, is all about escaping from the uneventful domestic scene to find excitement, and very often fortune, abroad. This kind of life, full of action and daring, was seen as more suited to boys than girls.