Ummm, that seems to me a "pareo".
I would say that a sarong is "unappropiate" in Madrid if you are going to walk throught the streets (in the sense that it is not commonly seen). However, it is very used when going to swimming-pools (even in Madrid) and on the coast towns and villages. Also very common (and a sign of well dressing) at beaches.
As far as I know it is mostly considered an informal clothe used when going to the beach or the swimming-pool.
Regards
Fernando