Obviously, this is a book about pirates, so it's also a book about crime. At the same time, it's an adventure novel, so there isn't much room for gritty realism here. Treasure Island is a fantasy of crime involving men with ridiculous names and parrots on their shoulders who are searching for literal piles of gold.
At the same time, while this isn't a realistic portrayal of pirate life, Stevenson's characterization does seem to reveal certain views about criminals. The pirates are all self-indulgent and childish. If they were more disciplined, they might have achieved all they hoped for, but their plans come to nothing because they have no self-control. This is what's led them to a life of crime in the first place. Stevenson seems to be suggesting that pirates and other criminals are trapped in a vicious cycle: they fall into the criminal life because they're reckless and careless, and this very self-indulgence and lack of discipline means they can't hang onto what they steal. The one exception to this rule is Long John Silver – but everyone recognizes that he's the odd man out in pirate society.
Both Long John Silver and Billy Bones are guilty of the "crime" of not sharing treasure with their fellow pirates. This is the only crime truly recognized by pirate law.
In this novel, pirates from a Christian background are caught in a paradox: they believe in God, but they are too self-indulgent to stop sinning. This paradox makes these characters unusually afraid of the afterlife.