The origins of the crescent moon and associated star symbols predate Islam as revealed to the prophet Muhammed by several millenia with archeological evidence of its use dating back to ancient Sumer. Thus these were originally pagan symbols with "the crescent usually being associated with the moon god Sin (Nanna) and the star with Ishtar (Inanna, i.e. Venus).
There are aleem that claim the cresent and star have nothing to do with Islam and remain pagan symbols that should not adorn the tops of mosques. They emphasize that masjids should be free of any symbols other than calligraphic verses from the Quran.
Other Islamic scholars opine that the crescent moon and the moon itself are significant in Islam. The moon is referenced many times in the Quran. There is a surah in the Quran named after the moon; surah 54 Al Qamar. In this surah a miracle of our prophet is mentioned where the moon is split asunder and moments later put back together. The onlookers dismissed what they witnessed as a magical illusion or trick. Some scholars also signıfy this revelation as the start of the muslim lunar calendar coinciding with the Hijra (migration) to Medina (Yathrib).
The Islamic calendar is based on the lunar month. A new month does not officially begin unless the new moon is witnessed. Since timing and scheduling of worship is based on the calendar moon and the daytime positions of the sun (Shems), it would be natural to put a symbol of the sun or the moon on top of the place of worship. The only practical and recognizable symbol would be the crescent moon since a spherical or semi-spherical object would be too obtuse.