Lord Shiva was not invited for the yagna of Daksha.
Daksha, in addition to being a son of Brahma, was also a King, with a royal lifestyle; Daksha did not approve of his daughters Sati ‘s marriage to Lord Shiva. Daksha did not like his daughter's yearning for Shiva, mainly because he was a Prajapati and the son of the god Brahma; his daughter Sati was a royal princess and Shiva was poor ascetic.
Sati is described to be very beautiful but the legends emphasize her penance and devotion, which won the heart of the ascetic Lord Shiva. Sati left the luxuries of her father's palace and retired to a forest to devote herself to austerities of a hermetic life and the worship of Lord Shiva.
Lord Shiva and Sati
According to the most popular narrative, Daksha organized a yajna (sacrifice) to which all the deities, except Sati and Shiva, were invited. Sati came to know about the grand yajna organized by her father and asked Shiva to attend the yajna. Lord Shiva refused her request, saying that it was inappropriate to attend a function without being invited. He reminded her that them not being invited was intentional.
Lord Shiva tried to stop her as he knew that Daksha would humiliate her, but when she was not convinced, he sent her with his gana attendants. Sati was received by her mother and her sisters, but Daksha was furious by her uninvited arrival and humiliated her and mocked Lord Shiva. Wanting to break all ties with her father and uphold the honour of her husband, Sati self-immolated. Deeply hurt by the death of his wife, Lord Shiva performed the destructive Tandava dance.
Lord Shiva Tandava