A well-managed pile of compost rarely attracts curious animals, one option is that you haven’t been taking care of the pile as much as you should be. Another is the very possible option that you placed something you shouldn't have, such as meat or animal fat, in the pile. This is going to attract animals to your pile no matter how often you turn it.