And I'll heartily recommend The Hat. It's a very short walk to the Plaza Mayor and not far from Puerta del Sol and the Sol metro.
The decor is industrial chic. 220 beds. If you want to socialize they have a very active happy hour as well as a rooftop terrace with a restaurant. They also organize pub crawls and a daily walking tour.
Fabulous breakfast for €3 includes the usual breads and cereals as well as ham, cheese, and fruits. You can make a sandwich and then toast it on a panini-type griller. There's a neat grocery store across the narrow street with a good selection and you can use the hostel's kitchen.
I went to say "hi I'll be staying here in 3 weeks can I leave a case with purchases til then?" And they said sure. They have a room dedicated to storing luggage and suggested I use a locker for €2! "A day?" (There's a place that charges €3/day). "Oh, no. Til u get here." I ended up coming to Madrid and stayed there one night prior to flying to A Coruña. I dropped off more shopping and they re-used my same €2. No charge if u just leave with other packs. The room is locked.
It has a nice vibe and a slightly upscale ambiance yet I paid €23-25/night. First in a 4-bed mixed dorm and then in a 6-bed female dorm. There was a card-activated door to the wing as added security. Elevator. They also will lend hair dryers, irons, and a padlock. It's best to take a small (not tiny) padlock with you for hostel lockers. There are some pretty patterned combination ones. I bought a regular one for €1.50 in a Chinese bazaar/dollar store.
Each bunk has a reading lamp, small shelf, electrical outlet, and TWO soft pillows. Storage lockers are either at the side or as a huge pullout drawer. Nice.
I learned that in all hostels you have to ask if you want a bath towel. I only had bath mats at the places where I had a private room. I just bought a microfiber dishcloth at the dollar store to use as a bath mat for my next trip.
Another general tip is to take a lanyard with a split ring/mini-biner and a clear pocket for ID cards. You never know when you will get a few keys or a plastic card and it's easier to keep them handy around your neck when you go out.