Maugham's story of an unfaithful woman who follows her husband into a cholera epidemic and ultimately earns redemption was inspired by a story in Dante’s The Divine Comedy. The Purgatorio section of the Comedy contains the lines "Pray, when you are returned to the world, and rested from the long journey, remember me, who am Pia. Siena made me, Maremma unmade me: this he knows who after betrothal espoused me with his ring." A tutor told Maugham that these lines were spoken by Pia, a women from Siena whose husband suspected her of adultery but was afraid to kill her because of her powerful family. He took her down to his castle in the Maremma and hoped that the noxious vapors there would end her life, but when she did not fall ill he threw her out of the window.
Maugham was intrigued by the idea of a jilted husband who forced his wife into a dangerous situation, and what the woman might experience there. In writing The Painted Veil, he decided to bring this story into a modern setting and change the ending.
The Painted Veil has often been hailed as a proto-feminist work: Kitty Fane shows a growth and dynamism that the men around her lack, and is ultimately able to move past the bad choices. The novel also emphasizes the importance of productive work outside the home for women, and the dangers that result from denying women access to education and other opportunities.
Maugham's vivid characterizations of unlikeable people prompted a number of lawsuits. He originally gave his protagonist the surname “Lane,” but was sued by a British couple with the same surname residing in Hong Kong, so he decided to change his character’s name to “Fane.” A.G.M Fletcher, the Assistant Colonial Secretary of Hong Kong, also threatened to bring legal action, so Maugham changed the setting of the story to the fictional colony of Tching-Yen; this has been switched back to Hong Kong in later editions.
The novel contains numerous thematic similarities to Joseph Conrad's 1899 novel Heart of Darkness, such as the exploration of the human psyche in the context of colonialism.
The book served as the inspiration for three different film adaptions, including a 1934 version starring Greta Garbo, which broke box office records by earning over 1.6 million dollars. Other versions include 1957's The Seventh Sin, featuring Bill Travers and Eleanor Parker, as well as a 2006 version starring Naomi Watts and Edward Norton.