He is presumably imprisoned because he is undead, not because of any crime. Upon meeting him he asks the player "how did you escape?" and the game tells you in the opening that undead are corralled into Lordran and imprisoned. The player has committed no crimes (presumably) but they are undead, so he must be imprisoned for being undead. Also, characters get captured and imprisoned all the time for little reason.