My first recommendation: Don't do that...
At least not the way you're describing. Entrepreneurship has never been one of D&D's strong-suits.
If it were me, I'd have a little bit of roleplay and hand-waving for the party to set up the new pirate king and make nice with the rest of the organization. Maybe a small check cut to the PC's every season/year whatever (a stake in the "company", so to speak). Then, the party can cruise around the islands, impervious to the pirates because they're friends(ish), now.
As an added bonus, you don't have to play the "my little band of pirates" mini-game.
If you're bent on running an organization:
The Setup: 400+ (several hundred) people is a lot. They're going to need a lifestyle between 'poor' and 'modest' or better (2sp-1gp per day). Some of that can be made up with a few survivalists or farmers, but still. Not all of the people on the island(s) are going to be active-duty pirates, either. You're going to have invalids and children (and just people that aren't pirates).
The Requirements: With the above in mind, that means you're going to need a large amount of money coming in (read: being pirated) to keep 400 people happy(ish); somewhere in the realm of 75-400gp per day.
The Payout: This requires that the downtime rules be allowed to apply to npcs. For reference, a comfortable lifestyle "costs" 2gp per day.
You can work between adventures, allowing you to maintain a modest lifestyle without having to pay 1 gp per day.
the same section talks about being a professional:
If you are a member of an organization that can provide gainful employment, such as a temple or a thieves’ guild, you earn enough to support a comfortable lifestyle instead.
I think a "Pirate den" counts as a thieve's guild for this purpose.
Proficiency in the Survival skill lets you live at the equivalent of a comfortable lifestyle.
So, IF you have enough "gatherers" (2gp-ish for farmers, fisherman, whatever) AND enough pirates (2gp ish for organized employment) AND enough schmucks (1gp-ish for other menial labor) to add up to around 400gp per day (or however many people you have) AND enough work/money leftover to upkeep this entire organization (ships/buildings/etc)...
Then, you should be able to provide and organize enough of a system to keep the various inhabitants of these islands functioning at a modest level or better, where your players can then skim the remainder as profit. Morale, however is a different issue (that I don't have any input on).
It's worth noting that going through a lot of trouble to "run" an organization, basically results in "players occasionally get a paycheck", which is the same as my first solution, but without all the thinking.