The Matrix echoes the Gnostic heresy: the world is a prison for our souls, the creator is evil, and knowledge brings freedom.
In the film, what appears to be reality is in fact an illusion created to enslave humanity. The red pill reveals the true world and grants the power to control the illusion to war against the creator.
For the ancient Gnostics, the material world was false. Our bodies and their pleasures, from food to sex, were oppressive deceptions. The truth, they believed, was that our souls are eternal, but this knowledge has been taken from us. Gnosis means knowledge - knowledge of our true natures, and how to transcend our earthly limits. The early Catholic Church declared the Gnostics heretics: for in the Bible, the creator is good, and so is his creation.
But did Gnosticism really fade away? Philosophers Augusto Del Noce and Eric Voegelin say no. They argue that Gnosticism has taken on a materialist, atheist form. The ancient Gnostics believed that Gnostic enlightenment would guide us to a spiritual Utopia. Revolutionary materialist ideologies - communism, socialism, fascism, progressivism - believe instead in a Utopia here on earth.
But, Del Noce and Voegelin say, these ideologies are fatally flawed. Like the Gnostics, and like the humans in the Matrix, they reject the world that exists. Their adherents' belief that better world is possible is so strong that they are willing to cast principle aside. If unborn generations can be spared the suffering of our fallen world, are not acts of violence really acts of love? But once principle has been lost, it can never be regained. The pursuit of Utopia degenerates into nothing more than the pursuit of power.
See Augusto Del Noce, The Crisis of Modernity; Eric Voegelin, Science, Politics and Gnosticism; and China Miéville, "Foundation," in Looking for Jake.