Good morning Victoria.
Spain is among the two or three most touristic countries in the world, so there are plenty of nice and lovely cities to stay.
However, you tell us that one of your goals is improving your Spanish. That's why Barcelona is not an accurate option because you're going to find Catalan and Castillian (local name for Spanish) speakers in the streets and, in the end, you will get confused. If you only have two weeks, you should not waste your time that way.
I recommend you to stay in Madrid to get your Spanish lessons and visit its vibrant cultural (and nightly) life where you'll live the Spanish language everywhere. You might perfectly catch a train heading to the south, i.e. Málaga or Seville/Cádiz, to get to the shore and see the beach. Alicante or Valencia are also cool and colorful places to spend a weekend under the sun.
So, it's up to you. Make up your mind and, please, share your decision with us all.
Regards,