I was thinking that working as a chef on a boat probably required some skill, and therefore if he was able to do so (or convince them he could do so), then he might have been seen as more trustworthy or less-scrutinized compared to a standard deckhand position.
So, the way that this is described in Treasure Island is as such:
I found he was an old sailor, kept a public-house, knew all the seafaring men in Bristol, had lost his health ashore, and wanted a good berth as cook to get to sea again. He had hobbled down there that morning, he said, to get a smell of the salt. I was monstrously touched—so would you have been—and, out of pure pity, I engaged him on the spot to be ship's cook. Long John Silver, he is called, and has lost a leg; but that I regarded as a recommendation, since he lost it in his country's service, under the immortal Hawke. He has no pension, Livesey. Imagine the abominable age we live in!
So there are a couple things to point out here: first, he's a cook, not a chef (some captains might have kept a chef for themselves, but that's not what's being described here); second, if Silver had lost his leg under the service of "the immortal Hawke" he would have been eligible for a pension from the Chatham chest, which I wrote about before. So to start off there's some artistic license being taken here with a poor old sailor with no pension ... but as we know from the book, Silver has plans to betray Livesey and Trelawney in any case, so there's some reason to view him as an unreliable narrator.
Ship's cooks were often disabled men who were enlisted for that position as a kind of sinecure -- they were the men who prepared oatmeal, puddings, salt meat and dried vegetables by boiling them; each mess of men (the eight or so men who would eat together) would do any fine work after that. (It's not actually totally clear in practice how this worked -- the reproduction stove aboard HMS Victory is way oversized but still seems too small to feed ~800-1000 men per day.) It was not skilled work at all.