I have seen these places but have not stayed there. I was in Madrid a few weeks ago and wrote down some names of places that looked decent and that were near the church.
450 m from the church, right on Calle Mayor. Pension Rodriguez
En pleno centro de Madrid, junto a la Puerta del Sol y la Plaza Mayor.
pension-rodriguez.blogspot.com
The Citadel (even closer, I think)
The Citadel es un hostal en el centro de Madrid. Ubicación ideal para recorrer la ciudad a pie. Habitaciones confortables y totalmente equipadas.
www.bypillow.com
Los amigos Hostal
Prices for these places rise and fall a lot with tourism seasons. Last minute booking deals might get you in a nicer place, at least that has been my experience.
Good luck with this. Buen camino, Laurie