There's camping on various sites directly next to the Nürburgring - Check
www.24h-rennen.de for details. There's a hotel near the paddock, prices are obviously through the roof for race weekend. Other options are B&B style places, but those are in the villages, not on the track.
What seems to be a popular option is renting a car, and buying cheap camping gear from
Decathlon and either take it home with you or donate it. Book at least one night in a hotel afterwards, for de-mudding (especially if it rains).