At an all-party meeting a day before the Monsoon Session, he also cautioned against giving political or communal colour to the issue.
"The Prime Minister urged all parties to extend their support to the government in fighting corruption and the issue of communal violence in the name of cow protection.
"Modi said state governments must ensure the maintenance of law and order and strict action must be taken against those who break the law," an official statement quoted Modi as having said in the meeting.
The Prime Minister also underscored the belief of many Hindus that cow is like mother, but said that this should not let people take law in their own hands and every state government should act against violation of the law, Parliamentary Affairs Minister Ananth Kumar told reporters after the meeting.
More From This Section
Opposition parties have attacked the BJP over the cases of cow vigilantism, in which Muslims and Dalits have often been targeted.
Modi also mentioned the presidential poll, slated tomorrow, and said it would have been very good had a consensus been reached on the candidate.
He said all political parties must ensure that everybody votes and no vote is wasted.
While the ruling BJP-led NDA has named Ram Nath Kovind as its candidate, the Congress-led group of opposition parties has pitted Meira Kumar against Kovind, who has a big numerical advantage over his rival.
Apparently indicating the recent cases against TMC leaders and RJD supremo Lalu Prasad, the Prime Minister those involved in corruption should not be saved, adding that the image of a political leader has taken a beating because of this.
Modi also thanked everyone for the implementation of the GST, calling it a "shining example of co-operative federalism".
He told the all-party meeting that 30 per cent of total expenditure and 49 per cent of spending in the infrastructure sector had already taken place before the monsoon started due to the advancement of the budget.
On the issue of Kashmir and tensions with China, Kumar said the government had a meeting with opposition leaders and every party has said they were with the government on matters of national security.
"The Prime Minister in one voice with the leaders of all parties also asserted that all political parties stand united to ensure the nation's safety and security, after such concerns were raised by many leaders on recent developments," it said.
There was a consensus across party lines on ensuring smooth functioning of Parliament without disruptions and deadlocks to be resolved through constructive discussions in both the Houses, the official release said.
Among those opposition leaders who attended the meeting were Ghulam Nabi Azad (Congress), Sharad Pawar (NCP), Sitaram Yechury (CPI-M), Mulayam Singh Yadav (SP), Farooq Abdullah (NC) and D Raja (CPI).
However, no one from the JD(U) or the Trinamool Congress were present. TMC has already announced it would boycott this meeting amidst recriminations between it and the BJP over the recent violence in West Bengal.