The Spanish government, fearful of the bond markets, enacted tough austerity budget measures that decreased Spanish people's incomes and therefore demand for the products of Spanish firms. This has pushed the country deeper into recession, so it should come as little surprise that their bond sales are now going poorly. That's counterproductive austerity at work.
To repeat myself, what a heavily indebted country needs is for its citizens to produce more output. That generally involves a larger share of the population working, and workers working for longer hours. If you do it right, it's an unpleasant experience. Instead of doing more work for more stuff, people are doing more work to pay off debts. But more work to pay off debts at least pays off debts. European austerity, however, is creating lower levels of employment and hours worked making it harder to pay off debts.