Despite is a preposition. Therefore it is followed by a noun or a gerund. It is a connector that is used to denote contrast.
e.g. Despite the heat, we carried on working. Despite feeling hot, we carried on working.
In spite of is an alternative to despite, but they should not be mixed. A common mistake is to add of to despite.
If you want to use a clause after despite or in spite of, you have to add the phrase the fact that.
e.g. Despite the fact that it was raining, we went for a walk.