The penal colony of "In the Penal Colony" was established by a man – "the old Commandant" – who single-handedly designed an elaborate and brutal system of justice that tied the colony together entirely under his control. Though dead by the time of the story, his rule and his justice system are revered with religious zeal by an officer who served under him. In the officer's eyes, the old Commandant becomes a god-figure, who brought perfect Justice (with a capital J) to the penal colony and who deserves its continued reverence and submission. Much of the old Commandant's system does indeed have strong resonances with religion, which has led some readers to interpret the whole story as a religious allegory.
"In the Penal Colony" is a religious allegory, in which the old Commandant represents God and his judicial system Divine Law.
The officer's reverence for the old Commandant is a product of brainwashing. There was nothing "godlike" about the old Commandant in reality.