It is unknown who had erected them, although the Great Council is a possibility. However, the magic barrier surrounding the Codex of Ultimate Wisdom clearly doesn't originate with them, since Naxatilor had put it on the Codex in ancient times. The Stranger was able to pass in Ultima IV, since the Quest of the Avatar counted as sacred quest.
The Stone Guardians were first encountered in Ultima V. They didn't allow passage unless the Avatar got a sacred quest from from of the eight shrines of Britannia. After all quests were fulfilled, the Guardians blocked the entrance. Strangely enough, should Lord British resurrect the party, the Guardians were visible as well.
In Ultima VI, the Stone Guardians still fulfilled their function. This time however, they also blocked entrance after speaking to the shrines, since no quests were given. Only after getting approval from the Shrine of Singularity did the Stone Guardians allow the Avatar to pass and reach the Codex.