When you defile something, you make it dirty or make it lose its purity. Think of fresh new snow covered in cigarette butts. The butts defile the winter wonderland.
For something to be defiled, it first must be pure. You can't defile a garbage dump or a messy room. Defile is often used in a religious context. If you were to burn a copy of the Bible or spray-paint the walls of a church, it could be said that you defiled the holy book or place.