It looks like he was sentenced to a bit over three years for that crime, and was released after serving it, then kept in detention while they tried to deport him. And since they can't deport him, they can't keep him in detention. And he's served his sentence for the crime, so he's free to go. I think this is legally the right thing to do.
I'm not sure that such a short sentence was the right thing in the first place, but I didn't see any articles about the original conviction, so I have no idea what the circumstances were, so I have to assume the court felt that that sentence was appropriate.