Supermarkets or market stalls.
Ok, technically that would mean shoplifting.
Unless you are in the Canaries you won't find bananas in Spain but if you come this month you can gorge yourself silly on nisperos which are in abundance everywhere. I think we call them Meddlar Fruit. Oranges are plentiful and figs when in season. You didn't say which area of Spain you meant so I can only talk about where I live.
Yes, I have often done it on old deserted farms. Figs, pine, nuts, mushrooms, wild asparagus, almonds, snails.
Wild asparagus, mushrooms and snails are taken freely by people in the countryside. Gleaning is allowed in small quantities.
Taking from cultivated fields and gardens is, of course, theft and there is always the risk of eating something that has just been sprayed with something highly toxic (red spider spray, DDT etc.).
In most capitalist countries, you have to PAY for the food you eat.
You will find fruits to buy in markets, and stores...food stores. They have special stores in Spain that sell nothing but fruits and vegetables, and there are supermarkets.
I will make a trip to Spain and in order to survive I would like to know where to find free bananas, oranges etc. in Spain to eat them