It's full of places, although for most of them you will need a car. The closest place to Madrid is La Pedriza, you can get a bus to Manzanares el Real and then walk a little bit, it's very crowded on weekends and the number of cars that can access is limited. Free camping is forbiden, although I think there is a camping area. It's a nice and interesting place. Other nice places are Cercedilla, Navacerrada and Cotos (you can arrive by train) and Rascafría(bus).
All these places are in sierra de Guadarrama, the closest mountains.
Farther places (2 hours from Madrid) but also interesting are Gredos with a glaciar lake and lot of endemic fauna, Alto Tajo, Hoces del Duratón, sierra de Ayllón.......
Sorry it's not easy to choose...