I prefer Barcelona to Madrid actually hahaha sorry folks.. But there are also cool places to go around Madrid (although admittedly not as spectacular as the Sagrada Familia and Montserrat ( accessible from Barcelona). Madrid is a good hub though if you want to cover as many cities as possible within a limited time. From Madrid you can easily travel to nearby cities that have their own charm as well : (Avila, Segovia, Toledo and Salamanca) .
Insider Tip:Blabla car.. This a cheap way to go around Spain.