Tripurantakamurti is the form of Lord Shiva, where he is worshipped for the reason he had demolished three demons by names Taarakaksha, Kamalaaksha and Vidyunmali. As the word Tripura gives the meaning the three cities. the epics say that the three cities acquired by these three demons were destructed by Lord Shiva.
The epic Shiva Purana says that there lived a demon king called Tarakasura and his three sons Taarakaksha, Kamalaaksha and Vidyunmali. These three have performed immence penance towards Lord Brahma and were granted three aerial cities revolving in the sky. The main aspect of their boon given by Lord Brahma is that they will be killed only when three of them were together and only by a single arrow. They created a havoc all over the Universe after they have been granted this boon and harassed all the beings including the Sages and Gods.
After listening to the Gods about them, Lord Shiva concludes that as long as they pray him. Then comes Lord Vishnu in the form of the sage deviating these three demons from praying Lord Shiva. They will pray themselves without knowing the fact they are losing their power and forgetting the boon they acquired. Consequently, after they lose the celestial powers, Lord Shiva destroys their cities and kills them.
As the three demons should be killed at a time and by one arrow, Lord Vishnu will become the arrow, the earth will become the Chariot and Lord Brahma becomes the Charioteer, while the sun and the moon will be the wheels of the Chariot.