Torrential rains have brought devastation to communities in eastern Spain as flash floods swept away buildings, destroyed bridges and piled debris in streets.