Not many people on the forum will recommend a trip to Tangier, so I'd question going to Tarifa at all. Morocco is wonderful, but Tangier is not. The good news is that there are flights to much more attractive Moroccan cities like Fes and Marrakech from several Spanish cities--as well as cities elsewhere in Europe--avoiding the time-consuming ferry business that only gets you to Tangier. You can check skyscanner.com for information (schedules and fares) on flights between Europe and Morocco. The schedules might vary seasonally, and they probably will not run seven days a week, but I found flights to both Fes and Marrakech from Barcelona, Madrid, Seville and Malaga. Flights are generally more frequent to Marrakech.
Tavira/Ronda/Tangier aside, all your destinations are linked by express trains. The distance from Barcelona to Granada is great enough (and the trains infrequent enough into Granada) that it's worth considering a flight. Many folks like to rent a car for the leg between Granada and Seville,, which don't have straight-shot train service. Although trains and buses are workable on that route, renting a car would allow you to stop over in Ronda and/or see one or more of the white villages (Arcos de la Frontera, Grazalema, Zahara de la Sierra, etc.).
If you aren't big fans of art who want to spend a lot of time in Madrid's art museums, I'd recommend transferring one night from Madrid to Seville. Four nights in Seville is rather minimal, I think (lots of sights and a rather large, atmospheric city), and five nights in Madrid might be more than you need, depending on how many day trips you want to take. You already have Toledo covered, but Segovia, Salamanca, Cuenca and Alcala de Henares are good side-trip options from Madrid.