Reproduced from : http://www.angelfire.com/realm/shades/ganesh/storybirthday.htm
It was Ganesh's birthday and he had been invited for dinner at a devotee's house.
Ganesh had a very heavy meal and was returning home on his mouse, when a snake crossed their path. Seeing this, the mouse got very frightened and ran away, in the process felling Ganesh. Ganesh fell and his stomach, which was very full, burst open. Seeing this the moon burst out laughing. Ganesh felt very humiliated, so he killed the snake and tied it around his stomach. He then gave chase to the moon who ran for his life. The moon managed to evade Ganesh and hid in his palace. Ganesh soon came there and stood guard outside, telling the moon, "Where will you go now? You have to come out sooner or later and then I'll take my revenge". It became very dark, as the moon refused to come out. This resulted in chaos on earth. The gods went and pled with Ganesh to free the moon. Ganesh finally relented and let the moon come out, but cursed him saying, " You hid in your house like a thief. Therefore, anybody who sees you on my birthday, will be implicated as a thief".
This is the reason why we are not supposed to look at the moon on the auspices of Ganesh Chaturthi. This was also the reason why Shri Krishna was accused of stealing the Shymantaka gem.