In pagan times, soul cakes were left outside on the night of Halloween to feed the spirits. The medieval church changed this to the practice of people taking cakes around to neighbors, which they offered in exchange for their neighbors' prayers for the dead.
No church undertaking could eradicate centuries of ancient beliefs. The Samhain feast and its associated beliefs and legends in the walking dead were too strong to be entirely replaced by another festival.
However devoted people were to the Christian religion throughout the year, many could not resist the pull of ancient superstitions and traditions on Halloween night.
Courtesy of Life in Medieval Times by Marjorie Rowling.