Neither would you get much for 400k in Germany or the UK. Also, real estate has gone up over the last four years in Spain unlike everywhere else. Some of the properties I've seen I could have bought 3-4 years ago for probably 30-50% less. But yes, Spain is still relatively cheap compared to other EU countries.
As for farming, absolutely. I had a finca for a couple of years in Spain and we grew all kinds of vegi and had fruit trees and a bunch of chicken. And what we didn't have we'd get from one of the neighbours. Looking forward to return there soon.