When you do something out of spite, you are doing it because you are angry at someone and you want to hurt them in some way. Usually the thing you are doing is completely unnecessary and the only reason you are doing it is to get "revenge" on a person.
For example, suppose you have a beautiful, expensive sports car that you cherish and have warned other members of your family that they are never to touch it. One night your teenaged son decides to sneak out in your car and take his friends for a ride. Instead of simply punishing him when he returns home, out of spite you phone the police and report the car as being stolen, so that your son and his friends will be arrested and spend the night in jail.