Hello :) As I know, tap water in Barcelona is actually sea water that underwent a process of desalination. Desalination is a complex and quite expensive process of removing various salts from water, in this case mostly NaCl, or commonly known as kitchen salt. read more
I wouldn’t say tap water tastes really bad, it depends on the area of the city. As is said in a comment from previous answer, the water comes from the two rivers close to Barcelona, so depending on which water you receive the taste will change (actually I thing the water is mixed). read more
Besides the other two answers, I finally learned in Geology class why our tap water does not have very good taste. However, this depends a lot where your actual supply comes from. Before I continue, let me confirm that I have lived 41 years in this city safely drinking this tap water. read more