There were other cases of that era where people got prison for life because of the embarrassment that would come from trial, so mundane reasons are possible. There's also the conspiracy theory one that he was imprisoned as someone a society was trying to enthrone -- that way, he was both a hostage and a block to their shifting to a new candidate.
But magical reasons would multiply possibilities widely. He is the rightful king -- and regicide would destroy the land by sympathetic magic. Or he's of royal blood, and it would rebound on the king. Or perhaps he's an obscure little charlatan with just enough magical ability to curse him, so that shedding his blood would cause widespread disaster. Or he's a foreign prince, and keeping him captive allows sympathetic magic to strengthen the conquest of his land.
Lots of possibilities.