Daksha cursed his son-in-law Lord Chandra or Moon that he would eventually become smaller and wane away because he did not treat all his wives equitably. Chandra prayed to the Somnatha linga, the first of the Jyotir Lingam and was blessed by a boon that he would honor Daksha's curse and also be released from its ill-effects. The moon would wane away in the Krishna Paksha and Wax in the Shulka Paksha.
Lord Shiva being all-merciful also honored his devotee by placing his on his head.
Lord Shiva who has countless forms is beyond form, name and gunas and is yet the base from which all names, forms and qualities arise. He wears the Moon, which waxes and wanes. The Moon like everything in nature waxes and wanes. Everything in life moves in cyclical fashion. That which does not change us Shiva.
Watch a video of a shloka that honors Lord Shiva as Chandrashekhara https://www.youtube.com/