This is the bark of the 'silk flos tree'. This tree is native to south America, but also grows in the south of Spain. In Spanish it's also called 'palo borracho' (drunken stick). The trunk is studded with thick, sharp prickles which stops wild animals from climbing the trees. In younger trees, the trunk is still green.
In winter months it's completely bare of leaves and flowers, especially when they grow outside of south America. I've never seen this tree give fruits here, but that's where it gets it's name from. Inside the fruits are beans that are covered in some soft, cotton or silk like material.