We're using friendship a little loosely here. We don't just mean the ties that bind people together; we're also talking about the ambition and greed that tears them apart. The guilt that Jim feels about deserting his post and leaving Squire Trelawney and Doctor Livesey to fend for themselves reflects the responsibility we feel toward the people we care about. We can contrast this sense of obligation with the extreme self-interestedness of pirate life. The pirates may appear to have a more equitable way of organizing their society, using direct elections based on respect. But in a system in which no man trusts another because they all lie, cheat, and steal at every opportunity, the only way to establish authority is through fear. No friendship is possible when everyone is just waiting for the next betrayal or double-cross. Treasure Island really hammers home the old lesson that crime doesn't pay: even if you get away with your loot, you'll spend the rest of your life looking over your shoulder and suspecting your nearest and dearest of robbery.
Because pirate society is highly individualized and self-interested, Long John Silver can only maintain control over his men through fear. Once he becomes the official captain of the pirates, his veneer of friendship to all of the men under his command disappears.
Friendship between Squire Trelawney and his three servants or between Squire Trelawney and Captain Smollett is impossible because the good guys in Treasure Island still maintain rigid class divisions.