The reason why it's illegal to carry ice cream in your pocket is because thieves once used the ice cream to lure horses away t steal them.
The law against carrying ice cream in your pocket, originated from an old tactic which was used by horse thieves.
The horse thieves would carry an ice cream cone in their back pocket, then a horse would smell the ice cream and follow it, which allowed the thief to steal the horse easily.
The tactic was also used as a way of avoiding being charged with horse theft, as the horse would follow the ice cream's smell.
The practice has been outlawed for a long time, some states have also only recently repealed the law.
Many states have either repealed the outdated law on carrying ice cream in your pocket or they no longer enforce it.
Kentucky repealed the law on carrying ice cream in your pocket in 1984, and the law on carrying ice cream in your pocket is now mostly just a historical oddity.
Although some states may still have some similar laws on the books, though they are not practical concern for most people today.