A judge has sentenced a prisoner for a death threat poem, saying the man’s words were “calculated and menacing”.