I also looked up the flights from Baracelona to Munich, and considering that all the flights had a stopover somewhere and ended up taking around 4 hours, plus time getting to the airport, preboard time, almost an hour into Munich after landing, I'll imagine that trip by air will take 6-8 hours.
According to Michelin, which I understand tends to underestimate driving times, just the driving time will be almost 13 hours. Add to that time to refuel, eat, and potty stops, it will be considerably more.
I like the idea of the night train part way, then a day train. At least with the train you don't have to stop for bathrooms, meals, etc. And with the train there are a lot of things you can do with your time rather than look at traffic.
Since there isn't really a good way to get to Munich, I have to ask the question, "why go there at all". Munich is probably my favorite place in Europe, but there are lots of interesting thing to see in Spain and on the French Riviera.
Or, take a train to Switzerland, spend some time there, then go to Munich. There is so much to see between Barcelona and Munich; why not take advantage of it.