In spite of = Despite = even though there is something unpleasant or bad happening.
In spite of/despite + noun OR verb with -ing OR pronoun.
“They never became rich, in spite of their success”
“Despite having a headache, I had a great birthday”
“The flight was cancelled. In spite of that, we arrived on time”
NOTE: ‘Despite’ is NOT followed by ‘to’