Despite is used as a preposition when something happens even though it might have been prevented by something else. You might go see a movie despite hearing a review calling it worse than Ishtar.
Despite is just one letter away from despise, and they actually share a root: the Latin verb despicere, meaning "to look down on scornfully." Despite came to mean "contempt" or "scorn" in English, though that use as a noun has mostly dropped out of use. The phrase "in despite of" gradually got shortened to the preposition despite and lost its scornful quality. If you accomplish something despite the obstacles in your way, there's no need to feel spiteful about it.