When we were in Madrid, we simply walked along the main street and watched for signs advertising rooms. The first one we saw was beautiful and only $35 per night for the two of us!
I've stayed at 2 places in Madrid: Hotel Ateneo Puerto Sol & Hostal Plaza d'Or. Both are good places, clean, nice rooms. The Hostal was cheaper than the Hotel, obviously. Metro: Sol