1.) While the dative is formally acceptable now, it is still considered erroneous grammar by conservative or language-aware speakers. In the standard language, wegen is hence usually followed the original genitive:

Die Autobahn wurde wegen eines Unfalls gesperrt. – "The autobahn was closed because of an accident."

Even in formal language, the dative case is normally used if the genitive would be indistinguishable from the nominative in form, which is the case with plural nouns not preceded by an article, determiner, or adjective:

2.) In the vernacular, and occasionally in writing, it is common to use the dative case after wegen at all times, whereby all the above peculiarities cease to apply. To some, the genitive may even sound pretentious in a private conversation. This is long-standing practice in the German dialects, which have mostly abolished the genitive per se.

Die Autobahn wurde wegen einem Unfall gesperrt. – "The autobahn was closed because of an accident."

3.) In very formal usage, wegen may be used as a postposition (always with genitive).

Die Autobahn wurde eines Unfalls wegen gesperrt. – "The autobahn was closed because of an accident."