Gnostic allegory..
According to Gnosticism, Man is a divine spark trapped inside a material body (prison) by a lesser god called Yaldaboth.
Yaldaboth created the world as a simulation (i.e. The Matrix) to keep humans enslaved to him, and distracting them from "remembering" their heavenly origin.
It's a ridiculous idea, but it is the basis of most of the esoteric religions nonetheless.