We've cycled a fair bit in northern Spain, it's a good country to tour in IMO. We rode the coast road south out of Barcelona for about 70 miles before turning inland, it's not a particularly nice route, busy and not very scenic and as has been mentioned, the camp sites tend to be expensive 'resort' type ones on the coast, you only need to go a few miles inland and it's much nicer (and cheaper), also if you're going in summer it's much cooler away from the coast. Although camp sites are scarcer and more expensive that in France, food and drink is much cheaper.
If you're coming out of Barcelona airport there's a bike path that runs around the airport periphery that you can access via an underpass from the ground level car park outside the terminal (it wasn't signposted when we were there a couple of years ago) CGOAB blog here;
https://www.crazyguyonabike.com/doc/?o=tS&doc_id=13062&v=8g