It mostly has to do with Madrid's international reach (or in this case, lack thereof)... The city struggles to project any sort of image beyond its borders while Barcelona continues to heavily be Spain's face abroad. Compared to Toronto, the Iberian exchange, in Madrid, is a lightweight, most of Madrid's corporations aren't of any significance beyond the Iberian peninsula. Culturally, the city has incredible museums, but the entire thing seems forced - as being the capital of a once great empire gets you the riches associated with it.
Transit is incredible, but then again every hamlet in Spain has good transit. Barcelona also does quite well in this department but has to deal with significantly more complicated engineering as the city is built on steep hills and surrounded by mountains. Housing prices are too high, a reason for the Spanish bubble that just destroyed their economy, housing stock is poorly built, quickly by greedy developers and the food is delicious but everything is fried.
Regardless - I think most people agree Barcelona continues to be Spain's premier city, even though Madrid is bigger and richer. The difference between Barcelona and Montreal is that Barca did not nuke its economy in the 70s, it was simply slowly passed by Madrid. The city continues to have a dynamic economy, a dynamic population and the entry point for most companies into the Spanish market. That is the main difference; Barcelona is still a thriving, wealthy city, Montreal is a stagnating relic who's heyday has long passed. I don't buy that international organizations in Montreal make it more global, otherwise Geneva would be the world's second most global city, which is a joke - let's face it.