Madrid’s accommodation options run the gamut from luxury hotels to
family-run pensiones and budget hostels where you can spend as little
as 20 euros a person. Check TripAdvisor and momondo’s hotel search for
hotel recommendations and book online for good deals. Consider staying
in a hostal or pension to save money and enjoy a homier atmosphere.
This post has some good ones: http://www.notesfrommadrid.com/2008/03/12/where-to-stay-in-madrid-part-i-hostales