The current government is almost entirely formed around economic growth at all costs, and attacks on minorities to make the majority feel empowered. The ruling party finds various anti-minority issues that no one would otherwise care about, and whips their supporters into a frenzy so it becomes an "us versus them!" issue.
It's the same as Trump insisting on building a wall, or making a huge deal of it if some random illegal immigrant kills some random white girl, or if a black man kills a cop. 90% of Americans wouldn't actually think about a wall or a random murder or cop killing on the other side of the country if it weren't for one political party using it to exploit votes. And 90% of Indians wouldn't care if someone happened to be eating beef if one political party wasn't driving every possible anti-minority issue to the extreme.
It's a purely cynical political move. No one doubts that there are politicians pushing the ban in public who love eating beef in private.
India's politics of meat
A Beef with Holy Cows
Not Religious Or Economic, The Cow Is Just Political