The fragrant flower is offered to Hindu Gods / Goddesses except for Lord Shiva. It is believed to have been cursed by Lord Shiva for bearing a false witness of Lord Brahma. According to a legend, once Lord Vishnu and Lord Brahma were fighting over the question of supremacy. The heated arguments led to an intense fight between the two. The devas, horrified by the fight, asked Lord Shiva to intervene. Lord Shiva assumed the form of a cosmic flame. Both Brahma and Vishnu were awestruck by the fiery column. Lord Shiva challenged both of them to measure the flame. Immediately, Lord Brahma took the form of a swan and went to find the base while Lord Vishnu assumed the form of varaha – a boar and went deep into the earth. Both searched thousands of miles but neither could find the end.
Lord Vishnu unable to touch the base came and admitted defeat. On the other hand, Lord Brahma during his journey upwards came across a ketaki flower waffing down slowly. Inquiring from the flower from where she had come from, ketaki replied that she had been placed at the top of huge pillar of light. Unable to find the uppermost limits Brahma decided to take the flower back to Vishnu to bear witness that he had reached the top of the pillar. He gloated over the defeated Vishnu. This infuriated Shiva. Brahma was punished for telling lie and cursed the creator that people would never worship him. (The legend explains why there is hardly any Brahma shrine in the country). Similarly, ketaki was also cursed that she would never again be used in worship of Shiva. Thus, ketaki is forbidden from being offered in worship to Lord Shiva even today.
(Legend source: http://www.tribuneindia.com/2002/20020401/agro.htm#1)