Some prepositions require the genitive. They are mainly used in written and formal language.
In everyday speech, you often hear the dative instead of the genitive – but for exams and texts you should know the genitive!
Formal: wegen des Wetters
Colloquial: wegen dem Wetter