Why all the gods insulted their sage Brihaspati? Mostly Devraj Indra insulted Brihaspati in Amaravati, which is the Capital of Devaloka. What is the reason behind it?
The story is told in this chapter of the Srimad Bhagavatam. Once Indra was seated in his court at Amaravati, capital of Devaloka, when Brihaspati guru of the gods came. But out of arrogance concerning his rule of the three worlds, Indra didn't welcome him or even get up from his seat, which greatly offended Brihaspati:
O King, once upon a time, the King of heaven, Indra, being extremely proud because of his great opulence of the three worlds, transgressed the law of Vedic etiquette. Seated on his throne, he was surrounded by the Maruts, Vasus, Rudras, Ādityas, Ṛbhus, Viśvadevas, Sādhyas, Aśvinī-kumāras, Siddhas, Cāraṇas and Gandharvas and by great saintly persons. Also surrounding him were the Vidyādharas, Apsarās, Kinnaras, Patagas [birds] and Uragas [snakes]. All of them were offering Indra their respects and services, and the Apsarās and Gandharvas were dancing and singing with very sweet musical instruments. Over Indra’s head was a white umbrella as effulgent as the full moon. Fanned by yak-tail whisks and served with all the paraphernalia of a great king, Indra was sitting with his wife, Śacīdevī, who occupied half the throne, when the great sage Bṛhaspati appeared in that assembly. Bṛhaspati, the best of the sages, was the spiritual master of Indra and the demigods and was respected by the demigods and demons alike. Nevertheless, although Indra saw his spiritual master before him, he did not rise from his own seat or offer a seat to his spiritual master, nor did Indra offer him a respectful welcome. Indra did nothing to show him respect.
Bṛhaspati knew everything that would happen in the future. Seeing Indra’s transgression of etiquette, he completely understood that Indra was puffed up by his material opulence. Although able to curse Indra, he did not do so. Instead, he left the assembly and in silence returned to his home.
Indra realized his mistake and wanted to go and apologize to his guru, but Brihaspati made himself invisible so Indra wouldn't find him. In the mean time, the Asuras attacked and without the benefit of their guru, the gods lost against them. So Indra and the gods consulted Brahma, told them to get a new guru, Trisiras, the three-headed son of the divine architect Tvashta. As I discuss in this answer, Trisiras taught Indra the famous Narayana Kavacha, a prayer to Vishnu, which allowed the gods to defeat the Asuras.
But ultimately Indra grew suspicious of Trisiras, since he was related to both the gods and the Asuras, so as I discuss in this question, Indra killed Trisiras by cutting off his three heads. This made Trisiras' father Tvashta furious, and he created the demon Vritrasura to take revenge on Indra. It is Indra's defeat of Vritrasura that Indra most known for in ancient times. And Brihaspati was back at Indra's side by the time Vritrasura came, as described in this chapter of the Devi Bhagavatam.