The budget options for staying in Spain are
quite extensive. All large cities have numerous
options including hostels, camping grounds
and monasteries/convents which often operate
for female travellers only. Camping grounds
tend to be a little further out of town so
may hinder night time entertainment plans
but do offer substantial savings. Often they
also have bungalows, cabins or dorm style
beds so you may not need a tent.
Rifugio's on major walking trails like the
Camino de Santiago in northern Spain often
provide free or very discounted accommodation
for "pilgrims" i.e those walking
on the route.
If you plan to stay long term somewhere you
maybe able to work out an arrangement with
the manager but some places do not enourage
long term guests and may impose a maximum
stay.
Some travellers report that they did not stay
in youth hostels in Spain at all as they were
not centrally located and the hostals / pensiones
were just as good value. Usually the hostals
/ pensiones will be cheaper for groups of
two or more but can be more pricey for singles.
Watch out for national holidays or festivals
when accommodation can be booked out.