With praise and thanksgiving they sang to the LORD: "He is good; his love to Israel endures forever." And all the people gave a great shout of praise to the LORD, because the foundation of the house of the LORD was laid. (Ezra 3:11)
After 70 years of Babylonian exile, the Israelites were back in their land, but without a temple, for the earlier temple had been destroyed and Jerusalem burnt with fire by King Nebuchadnezzar during his 3 invasions of the land.
The elders who had witnessed the glory of the former temple built by Solomon wept and the younger generation rejoiced that the new temple foundation was being laid.
When the builders laid the foundation of the temple of the LORD, the priests in their vestments and with trumpets, and the Levites (the sons of Asaph) with cymbals, took their places to praise the LORD, as prescribed by David king of Israel. (Ezra 3:10)
They were starting the new project by praising God, trusting that he would help them complete.
Who would have ever thought that the wonderful temple built by Solomon would be laid waste? It had taken 7 years to build and it was a magnificent monument. Nothing could match it's grandeur in that era. But King Solomon married foreign women who worshiped idols and he was no longer faithful to God who had given him everything from knowledge and wisdom to riches and fame. Of the kings that followed Solomon's reign, only a few were faithful to the Lord.
Sin had led to punishment- an exile and now they were being restored by God himself. Joy and sorrow were both witnessed at this solemn occasion.
Many of the older priests and Levites and family heads, who had seen the former temple, wept aloud when they saw the foundation of this temple being laid, while many others shouted for joy. No one could distinguish the sound of the shouts of joy from the sound of weeping, because the people made so much noise. And the sound was heard far away. (Ezra 3:12, 13)
They praised God vociferously hoping and trusting that what they were starting would be brought into completion by God. And God was faithful. He did not leave them nor forsake them. The temple was built.