The wealth and the gains are mentioned because he was arrogant with them, he used to say: If what my nephew say is true, I will redeem myself with my money and children. Thus Allah (swt) answered back with this saying that his wealth will not avail him or save him from the Allah’s punishment.
The scholars have two opinions about this verse: First, money is the origin that a person possesses then comes the gains and profits. The second opinion is that the gain means children according to the Prophet’s (saws) hadith:
“The Messenger of Allah said: “The best (most Pure) food that a man eats is that which he has earned himself, and a man’s child (and his child’s wealth) is part of his earnings”[1]
Then the Surah moves to talk about the retribution in the hereafter:
[1] Sunan Abi Dawood, hadith No. 3528.