Allah did not expose him!
Musa عليه السلام took about 70,000 people out to pray a prayer for rain. This prayer happens when there is a drought, all the people will go out to the field and offer prayer, invoking Allah to give rain.
During the drought years Musa عليه السلام took about 70,000 of his people to the field to offer prayer for rain. Usually the people go because they are righteous, good, devoted, pious people, when they offer the prayer Allah will accept it.
For example, the Prophet صلى الله عليه وسلم once was giving khutbah during jumm'ah and a man entered into the mosque where the Prophet was lecturing, the man said, O Prophet of Allah there's a drought, we have no water! The Prophet صلى الله عليه وسلم rose his hands up and he made a duah for rain. Do you know what happened? The rain came down, it continuously fell with no stop, the whole week it was raining profusely. Then the man came back again and said, O Prophet of Allah, there's too much rain. The rain never stopped until the following Friday. So the man came and asked the Prophet to ask Allah to stop the rain, then the Prophet made duah.
So we can see there is a special prayer for rain, go there offer prayer, make duah and make istighfaar, because when there's a drought it means that there's a lot of sins.
So Musa عليه السلام took 70,000 people to offer prayer asking Allah for rain. They ask Allah, and usually Allah answers it just like he did with the Prophet, however in this case the rain didn't come down. Then Musa said to Allah, O Allah we have come to you, send the rain abundantly like you do every year. Allah replied to Musa, 'There is one man amongst you, he is disobeying me, being rebellious and spreading evil for 40 years, because of that there is no rain - because of him there is no rain, because of him I didn't answer you.’
Then Musa said ‘I want to know that man so I can tell him to leave, so we can have rain.’
Allah said to Musa ‘just say it loudly and I will have him hear it.‘
You know this is 70,000 people and there was no microphone or anything at that time, so Musa said how will I reach them? Allah told him to just say it and He will have it conveyed/inspired to him.
Musa said ‘O people there is amongst us a man he has been disobeying Allah, rebellious, committing all types of great sins, because of him we have no rain!’
They waited and waited however no one stepped forward. On The contrary the rain started coming down all of a sudden anyway, it came down abundantly. Then Musa said to Allah, ‘O Allah you told me because of that man there's no rain. No one came out when you told me, no one left and you still gave the rain.’
Allah said, ‘O Musa he repented in one second. He put his head down and said, O Allah how will I go out with 70,000 people looking at me?! He repented to me. That's why I gave the rain.’
Then Musa asked Allah, ‘ I would like to know who this man is.’
‘O Musa, he's been disobeying me for 40 years then after he repented. I didn't tell you about him before and you want me to expose him to you now?!’
ONE second and that's it! ONE moment he repented with sincerity, he was in need and Allah forgave him right away! See how Allah's forgiveness is, He is generous. When you go to Him sincerely He is there to help you out!
ONE moment of sincere repentance and Allah demolished all his 40 years of sins in that one moment!
Keep repenting, repent sincerely!
- Shaykh Musa Jibril حفظه الله