All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
It is impermissible for a person to take the money given to him for the building of a masjid or any other purpose for himself; verily, this is betrayal and a breach of trust. If it is found out that someone is committing such a sin, then he should be advised to give it up; if he refuses to accept the advice, then the people should be warned of his actions and this has to be reported to the concerned authority who can prevent him from committing this sin. The Prophet said, "Whoever among you sees an evil action, then he should change it with his hand (by taking action); if he cannot, then with his tongue (by speaking out); and if he cannot, then with his heart (by hating it), and that is the weakest form of faith." [Muslim]
Moreover, the Prophet said, "Religion is exchange of sincere advice." People said, "To whom should it be directed?" He replied, "To Allaah, His Book, His Messenger, the leaders of the Muslims, and the common folk of the Muslims." [Muslim]
It is impermissible to curse or insult a Muslim; the Prophet said, "A true believer does not slander, curse, or speak in an obscene or foul manner." [At-Tirmithi and Al-Haakim - Al-Albaani graded it saheeh (sound)]
It was narrated on the authority of Salamah ibn Al-Akwaʻ that he said, "Whenever we saw a man cursing his brother, we would count his act as a major sin." [At-Tabaraani reported it with a good chain of narration]
Hence, what that man did, cursing the one advising him about wrongfully taking the donated money for himself, is impermissible. It does not affect the cursed man because when a person curses someone undeserving of being cursed, then the curse rebounds and comes back onto him. Abu Ad-Dardaa’ narrated that the Prophet said, "When a person curses somebody or something, the curse goes up to heaven, but the gates of heaven are closed to it. It comes back down to the earth, but its gates as well are closed to it. So it turns right and left, and if it does not find an entrance to go anywhere, it returns to the person or thing that was cursed if he or it deserves to be cursed; otherwise it returns to the person who uttered it." [Abu Daawood - Al-Albaani graded it hasan (good)]
Allaah knows best.