If a task from a sequence was created and assigned before a contact was unenrolled (either manually or via some automatic means), any tasks will still be present for contact records, and that is the expected behavior in this case.
The tasks showing in the inbox are not conditional on if the contact is still currently enrolled into the sequence, but the creation of the tasks, based on the steps of the sequence, are, which is to be expected.
If a prospect is unenrolled from a sequence before a task gets created from the sequence, then the contact would not have the task created and assigned inside the Inbox.