Sedition is defined in Malaysia as an acting that may engender "feelings of ill-will and hostility between different races".
Illegal assembly is punishable by a one year in jail and a fine, while sedition is punishable by up to three years in jail and a fine.
On August 28, more than 50 people claiming to be residents of the neighbourhood marched from the state mosque to government offices to protest the relocation of their temple to the area where they live.
The protesters stopped at the gates of the office where they stamped on the cow's head after listening to fiery speeches by their leader.
The court in Shah Alam freed all 12 on bail. No date has been set for the trial, but the case will be heard again on October 21.
According to local officials, five of the six men charged with sedition were residents of the neighbourhood where the 150-year-old temple was to be relocated.
Only one of the six others facing illegal assembly charges is a resident.
Salehuddin Saldin, a defence lawyer, told the Associated Press news agency that his clients did not intend to offend Hindus, and carried the cow head only as a symbol of the state government's "stupidity".
"It is not a serious offence. If you look at the Malay culture, the cow is synonymous to stupidity and not meant to insult other religions," he said.
|The protests have drawn condemnation from all ethnic and religious groups
P Uthayakumar, a prominent Hindu activist, dismissed the argument as "laughable".
He said: "It is a lame excuse and completely unacceptable.
"They are clearly inciting the Hindus."
The situation came to a head when a group of men disrupted a town hall meeting with residents last week organised by the state government.
Heated arguments ensued between those for and against the temple relocation.
The incident has highlighted frustrations among religious minorities about
guidelines that are said to restrict the number of non-Muslim places of worship.
These are partly based on whether enough people of the non-Muslim faith live in the area where the church or temple is to built.
State authorities in Selangor later said that they had found a new site in Shah Alam to build the temple, a few hundred metres from the original site and further away from the local mosque.