If you’re in the area it’s worth a quick stop, but I wouldn’t go out of my way to visit. The siege and WWII tunnels might be worth seeing if you like that sort of thing. When I lived in Spain in the late 70s, the border with Gibraltar was closed, so on a number of occasions I stood on the Spanish side of the border and was only able to look across it at the rock. Took my children there in the 90s and was happy to be able to cross the runway and go up the rock. Now that I did that, I have no desire to return. Since you intend on being in Tarifa, Gibraltar is only about 20 miles away.
If you intend on driving, once you have a pretty good idea of your itinerary, research some of the smaller towns along your route. Some may have sights you’d be interested in seeing, or May simply be interesting enough to walk around or stop for lunch. You get a better view of the countryside from the smaller roads, but it will take longer to get to your destination.