Answer:
Lord Varuna cursed and punished Raja Harishchandra because the king had broken his word and did not fulfill his promise to the sage Vishwamitra.
The sage had asked Raja Harishchandra to give him a thousand cows, and the king had agreed, but when the time came to fulfill this promise, the king refused to do so.
This angered Lord Varuna, who then cursed and punished Raja Harishchandra for his dishonesty.