Counter-intuitively, you must not beat the game to unlock Lancelot.
Lancelot is Shadow's alter ego in the Storybook series, and his unlock condition is tied to progress short of the final completion rather than to finishing the last stage. Getting all the way to the end without triggering the requirement is the mistake most players make, which is why this question is asked so often.
If you have already completed everything, check the character select screen — unlocks that appear tied to the story are sometimes granted on a subsequent file rather than retroactively.