dear freinds, the siva agamas clearly states the duty of siva is to destroy the anava,kanma and maya from men. the three are called thiri-puram by later purana period.
the purana period used the abstract forms of vedas and agamas and made stories out of them for the common people to understand.
the three malams are unique to saivasiddhantha school (anava,kanma and maya). the mala are to eliminatd by every human being in systematic ways. ref: dhasakariams -books by 14 pandarasastras of thiru-avadu-thurai.
the thiripuranthaka images were very dear to cholans especially RRC. he painted the inner walls of the great tanjore temples with the thiripura dhaganam scenes.
in saiva books the thiripura dhaganam is considered a duty of siva to each soul. the place seer-kazhi derives its name from this concept. kazhuvu(cleanse)- malam. kazu-malam became seer-kazhi later and the river here is still called kazu-mala-aru.
siva has five duties: akkal,kathal,thudaithal,maraithal and arulal. the thudaithal maraithal functions are often referred to both malams and gunas. the gunas are also three dhamo, rajo and sathva. some scholars like sithbavanandhar opine thiripuradhaganam is destruction of the gunas. whereas some scholars say it is for the malams.