A New York federal judge has spared three of four men convicted in a terrorist bomb plot from life in prison, saying their crime never would have been committed without the government’s sting operation.