Thoroughly bad, as in It seems that this police unit is rotten to the core, involved in numerous extortion schemes. The noun core here denotes the central part or heart of anything or anyone. The idiom was first recorded in 1804.
The American Heritage® Idioms Dictionary Copyright © 2002, 2001, 1995 by Houghton Mifflin Harcourt Publishing Company. Published by Houghton Mifflin Harcourt Publishing Company.