Is flying the best way to go from Granada to Barcelona?
There's a night train that takes about twelve hours and costs around ninty euros or so. Considering it would serve as a hotel and let you travel while you sleep instead of devoting at least half of a waking day to the transit, this would probably be the way to go.
I would go with the train to make the most of your time. Spending a half day flying from one spot to another, when there is an easy train option, seems like a waste of precious time. Plus, as previously mentioned, it serves as your hotel as well.