A man accused of planning to kidnap, rape, and eat children in a soundproof dungeon in his basement has been sentenced to nearly 27 years in prison.