Did you know that King Daksha had twenty seven stars as daughters, and all of them were married to the moon. But here is the other side of the story : the moon had special attraction towards Rohini . So what was to happen, all the other wives made a big issue of it all and went and complained to their father Daksha that their husband moon is not treating them fairly.
Now look at the rage the father got into when he learned that his daughters were not being treated properly : Daksha put a curse on the moon under which it would lose its luminance day by day. And from that day onwards the moon started losing it's luminance part out of his 16 parts. And with this happening , and the moon losing it's luminance each day , it got afraid and ashamed and thereafter disappeared into the ocean. As a result of this,there were many herbs which require the light of the moon to grow, which started suffering in the absence of the moon.
Moreover , due to the moon disappearing in the ocean, there was a lot suffering in the entire world and it was to end this problem only that the celestials advised the moon to take refuge in the Lord Shiva, and left with only one kala, he took refuge in Lord Shiva. Being the graceful Almighty, Lord Shiva wore the moon crescent on His head, making him grow for 15 days and decay for 15 days periodically.
This is the story behind how Lord Shiva has come to have the crescent of the moon on his forehead !