Those were Kakashi's flashbacks if you actually payed attention bro.
to find out about where he learn the eight gates from and where he got his idea for the power of youth
To buy time for naruto and sasuke to arrive. And to protect everyone from madara, who without gai being there, would have continued to slaughter everyone.They been using flashbacks hinting at Gai's death that was supposed to go out with a bang, now that he's going to remain alive the question now arise.
What was the point of it all, I mean at all ?
I think he mainly was mad at the flashbacks b4 the 8th gates...
To buy time for naruto and sasuke to arrive. And to protect everyone from madara, who without gai being there, would have continued to slaughter everyone.