In Indian Mythology, people worship the Trimurti where we pray Lord Shiva, Vishnu, and Brahma. Brahma is known as the Hindu god of creation. He is also regarded as the father of Dharma since he has created the Vedas and the Hindu scriptures.
There are two stories which people say and believe.
The first story of Brahma says that he created 10 sons and a beautiful woman from a part of his own body. He named her Shatarupa (a lady with 100 faces). Shatarupa is also known as Savitri, Brahmi, Saraswati, Gayatri, and much more. The woman turned out to be so attractive that Brahma himself fell in love with her extraordinary beauty. He started following her everywhere she went and to such an extent that he created the fifth head for himself. These 5 heads used to look for Shatarupa no matter whichever direction she went. This made her feel embarrassed and disgusted due to which she descended from heaven.
Being a father to Shatarupa such behavior was unholy and hence it made Lord Shiva angry. He took the form of Ardhanarishvara by merging with Goddess Parvati and showed Lord Brahma that there is no difference between the soul of a male and a female, instead it’s just the outer body which has different forms. He got furious and cut Brahma’s third head and roamed around the world with his skull till he reached Banaras.
Secondly, according to Shiva Purana during the beginning of creation, of the universe, Vishnu and Brahma were arguing over who was superior of the two. They approached a huge Shiva linga and set out to find its beginning and end. It was decided that Vishnu will seek for the end and Brahma for the beginning. Vishnu began digging downwards into the earth by taking the form of a boar, while Brahma took the form of a swan and flew upwards. But both failed to locate the ends. Vishnu came back convinced that there’s no end to it but Brahma did not give up so easily. While he was flying he witnessed a Ketaki flower and asked it to lie about the discovery of the Shiv lings beginning. Since Lord Shiva was already aware of the truth he became angry and burnt Brahma’s 5th head and cursed him that no person would worship Brahma