Even before the Horus Heresy the Word Bearers Legion began to worship the Emperor as a God, indeed this, at least in part laid the foundations for the Horus's eventual rebellion.
Also the Thousand Sons pursued research into psychic powers even after this was forbidden by the Emperor, although there is a reasonable argument that Magnus never intended to betray the imperium untill Horus duped Leman Russ into razing Prospero, probably because he saw a loyalist psyker legion as his biggest threat.
So one of the big sources of tension in the early Imperium during the great crusade was that the Imperial Truth declared any sort of religion false, but chaos entities were able to pass themselves off as gods.
Here the Emperor had a dilemma as he knew that the Chaos 'gods' fed off belief and indeed the whole point of the Great Crusade was to defeat Chaos by cutting of their access to belief by eliminating superstition from the whole of human culture. Unfortunately the message that 'gods to exist but acknowledging their existence will ultimately destroy humanity' is quite a hard message to get across. This was compounded by the fact that several primarchs discovered the existence of Chaos independently without understanding the threat it posed and were manipulated by it.
There is also a reasonable hypothesis that Chaos's plan all along was not to destroy the Imperium but to manipulate it into a semi-stable state where the original concept of atheistic 'Imperial Truth' mutated into a cult of superstitious emperor Worship which would provide the undirected belief that they needed and could exploit.