Hi there, I am a spaniard living in the Uk for a few years now. As fussychica said, I wouldn't worry about old flats, farms, cortijos but be a little bit more cautious if buying fairly new villas, specially for those with sea views on the south of Spain, Valencia, Murcia....
The areas that have been built illegally are usually those ones on the hills very close to the sea.
I would say now is a good moment to buy as the market is quite low if you are not looking to sell quickly, or not looking for a buy to let. If you are just looking for a place for you and your family to enjoy, and you are planning to keep it long term you shouldn't have any problem.
Have you thought about buying on the Costa brava? You have Barcelona and Girona airports, and the area is beautiful and not so overdeveloped. Or maybe one of the Balearic islands? That would be my personal choice but it's not nearly as cheap down there so everything depends on your budget.
It also depends on what kind of place you are looking for, do you want to buy a big villa with swimming pool and lots of outdoor space, or would you be happy with an appartment in the town centre jus 10 minute walk to the beach? Lots of things to consider!!