Personally, I think Barcelona is better than Madrid, but I did live there for two years, so I'm somewhat biased. I feel there's more to do in Barcelona as a tourist, plus you can visit the beaches in the city or down the coast, which you can't do in Madrid. That said, Madrid does have some great museums and visiting the football stadiums is fun too. But Barcelona edges it for me.