Difficult ocean voyage
Building and navigating a long-distance ocean-going vessel aren't particularly easy skills to just develop on your own just because you need them. If the players were on a long distance voyage, many days away from any safe land when they were wrecked on this island, then this would be quite a difficult and time-consuming endeavour. Even just gathering enough supplies that they don't starve would be a major effort.
Of course, this point largely relies on the players and their characters realising this and so deciding not to try. You don't really want to have to actually use the difficulty of the voyage against them, because if you do the story simply ends with them drowning at sea, which doesn't work.
If the players make a quick raft and launch it immediately, despite your telling them how far their previous voyage had travelled since they last saw land, you can have them immediately wrecked close enough to the island that they can make it back.
If they take time on a more serious effort, that gives you time for:
The demons don't want people leaving
Whether the demons' rituals are building up to some particular plan, or they're just living here feeding on the inhabitants, they don't want it known in the world outside this island that they are here. Perhaps major countries or religions would arrive in force to destroy them if their presence is known. Perhaps not, but the demons fear it is possible.
So the demons actively patrol the island for people attempting to leave. The party's ship-building camp might be attacked by a small group of demons one night. When it becomes clear the PCs are capable of putting up a good fight, the demons will attack in greater force.
You can push this as far as making it so that in order to be free from demon attacks in order to finish building and stocking their ship, they essentially have to defeat the demonic forces on the island anyway; the demons through everything they have at the party, up-to and including the evil overlord attacking in person. No party I've ever played with would actually make the GM do that though; they will hopefully display some interest in what is obviously the plot the GM has in mind and go chasing up what the demons are doing here.
This works for the people living on the island too; they've learned the hard way that the surest way to bring the attention of the demons is to start building a ship.
Don't wait for the party to discover the town
People from the town are aware that a ship has wrecked on or near the island (perhaps they saw it go down, or maybe they've just noticed bits of wreckage washing ashore). So there are searchers who discover the party's camp (either organised searchers looking for survivors, or opportunistic ones looking for salvage).
Or maybe some foragers or farmers happen to spot the camp as they're heading back to the town, and can tell the party it's madness to sleep outside the walls because the demons always come at night.
Or their campfire was seen on the first night, so a patrol of soldiers from the town come to investigate, in case it was a sign of demonic activity.
If the players declare they want to spend many days working on a ship on the beach, without exploring the island, that gives you plenty of time for other groups on the island to believably discover them, and therefore introduce the framework of your intended story.
The players want an interesting story
Basically, the best way to make sure they don't spend game time figuring out how to build a ship is to give them something more interesting to do. D&D doesn't really have any tools to shipbuilding an interesting gaming experience anyway, so this isn't hard. Just have your plot make contact with the players, and they'll likely want to follow it.