Mughal rulers understood that by killing cows and giving their open support to cow slaughter, they cannot rule for a long period. Even Babur, in his will, has written we can't do two things at one time. Either rule the hearts of people or eat cow's meat.
On protecting cows, as quoted in "Even Mughals did not support cow slaughter: Rajnath Singh", Hindustan Times (8 August 2015)