How many nights can you spend in Spain? I'm not clear on whether your 5-7 days includes your travel days.
Southern Spain (Seville/Cordoba/Granada--though the latter is at altitude and a bit chillier) is likely to have significantly nicer weather than the area around Madrid. Barcelona tends to be in the middle. The Wikipedia entries for each city have climate-summary charts so you can compare average temperatures, rainfall, etc. Keep in mind that the averages do not reflect how chilly (or how warm) it is likely to be over the course of your trip. I do use them for an estimate of how much colder City A might be than City B.
As a hater of cold weather, I'd have a strong preference for Seville/Cordoba for a trip in March. (I went to that area myself in early April 2019.) I suspect you don't really have enough time to include Granada. However, when you look at flights--which I'd recommend doing immediately, so you don't fall in love with an impractical itinerary--you may well find that it's much easier and/or cheaper to fly into Madrid or Barcelona than one of the southern cities (you can check Seville, Malaga and Granada). In that case, I'd recommend caving in to what's practical if you're not in a position to postpone your trip (which is what I'd do, in all honesty). You can certainly have an enjoyable time in Barcelona or Madrid in March even if you're unlucky with the weather. They both have good indoor sights, lots of restaurants and tapas bars to explore.
Barcelona has some nice side-trips. Madrid (which I don't like as much as a city) has many really magnificent side-trips. Malaga and Cadiz are both pleasant, but they rank well behind Seville, Cordoba and Granada. On such a short trip, I wouldn't plan to include them unless I was flying into Malaga, in which case a day in that city would be worthwhile.
I have never been interested enough in Gibraltar or Marbella to see either one. I believe everyone will tell you they trail far, far behind Seville, Cordoba and Granada in terms of tourist interest. I'm also wondering whether Marbella might be rather dead in March. Travel time to get there from anywhere except Malaga would be significant; I have a hard time imagining it would be worth it on such a short trip even if you could count on beach weather (which of course you will not have).