Arrival day: even if you land in the morning, it can take you an hour or two to get through the airport, another hour to get to your hotel and drop your luggage. You are likely to be sleep-deprived and jetlagged, so your first day will be a hazy struggle to stay awake and you won't absorb much. Departure day: you have to be at the airport 3 hours before departure and you'll want to alow an hour to get there. Unless you have an evening flight, you have no time to do more than a lesiurely breakfast and/or a short stroll before picking up your luggage and leaving Barcelona. That's why you have 8 days, not 10.
I don't know who told you 2-3 days is enough in Barcelona. You could easily fill your entire time just in the city and there are several great day trips too. Browse this site. OTOH I would agree that Madrid doesn't need more than a day or two, unless you enjoy European painting, in which case you'll want 2 full days just for the 3 major art museums. And as others have pointed out, there are good day trips too.
All in all, since you are locked into R/T Barcelona, don't waste a half-day of travel to another city and another half-day getting back to Barcelona. That's 3 hotel changes and a full day wasted. I've spent over 14 full days in Barcelona in 3 visits, and the only sight I can remember revisiting is MNAC, a great art museum and that was because I didn't allow enough time there on my first visit.