People's attitudes change with time. One can see this change in Hindu scriptures also. The earliest scriptures talk explicitly of meat eating even eating beef.
Chandogya Upanishad says that some spiritual aspirant takes a vow to not eat fish and meat for a year or to permanently stop eating non-veg food. The exact shloka is:
He who thus knows this Yajnayajniya Saman, woven in the limbs of the
body, is endowed with all the limbs, and is not crippled in any limb;
he reaches the full length of life, lives gloriously, becomes great
with offspring and cattle and great also with fame. His holy vow is
that he should not eat fish and meat for a year, or rather, he should
not eat fish and meat at all.
Chandogya Upanishad 2.19.2
Brhadaranyaka Upanishad says,
' He who wishes," May a son be born to me, who will be required
scholar, attend assemblies, speak words that one likes to hear, be
versed in all the Vedas, and attain full longevity", should have rice
cooked with meat - that of a young and mature bull - and with his wife
eat it mixed with ghee. Then they will be able to produce such a son.'
That would imply that ancient Hindus used to eat meat.
Brihadaranyaka Upanishad 6.4.18
There is also a passage that directly praises offering of Beef at Sraddhas:
Bhishma said, ' Listen to me, O Yudhisthira, what those havis are
which persons conversant with the ritual of the Sraddha regard as
suitable in view of the Sraddha and what the fruits are that attach to
each. With sesame seeds and rice and barley and Masha and water and
roots and fruits, if given at Sraddhas, the Pitris, O king, remain
gratified for the period of a month. ......With beef presented at the
Sraddha, their gratification, it is said, lasts for a full year.
Mahabharata, Anusasana Parva, Section LXXXVIII
Later scriptures condemn animal sacrifice. For example, Bhishma said in Mahabharata,
"Beholding the mangled body of a bull, and hearing the exceedingly
painful groans of the kine in a cow-slaying sacrifice, and observing
the cruel Brahmanas that gathered there for assisting at the
ceremonies, that king uttered these words, ‘Prosperity to all the kine
in the world.’ When the slaughter had commenced, these words
expressive of a blessing (to these helpless animals) were pronounced.
And the monarch further said, ‘Only those that are transgressors of
defined limits, that are destitute of intelligence, that are atheists
and sceptics, and that desire the acquisition of celebrity through
sacrifices and religious rites speak highly of slaughter of animals in
sacrifices.’"
Mahabharata Santi Parva Section CCLXV
Another passage in Mahabharata says,
'Cast thy eyes, O Jajali, on those bullocks yoked to the plough. Kine
are called in the Srutis the Unslayable. That man perpetrates a great
sin who slays a bull or a cow. In days of yore, many Rishis with
restrained sense addressed Nahusha, saying, " Thou hast, O King, slain
a cow which is declared in the scriptures to be like unto one's
mother. Thou hast also slain a bull, which is declared to be like unto
the Creator himself. Thou hast perpetrated an evil act, O Nahusha, and
we have been exceedingly pained by it."'
Mahabharata Santi Parva Section CCLXII
The Sanskrit word for cow is go. The word go stands both for cow and rays of the sun.
Kine – rays of the sun
In respect of the prosperity and the growth that kine confer, in the
matter also of the protection that kine grant unto all creatures of
the earth, kine are equal to the very rays of the sun that fall on the
earth. The word that signifies the cow stands also for the rays of the
sun. The giver of a cow becomes the progenitor of a very large race
that extends over a large part of the earth. Hence, he that gives a
cow shines like a second sun in resplendence.
Mahabharata, Anusasana Parva, Section LXXI
In Hinduism light is usually a metaphor for spiritual illumination. Thus a cow is a symbol of the spiritual light within us. Just as the sun supports entire life on Earth similarly the spiritual light within gives us consciousness,i.e., makes conscious life possible. It is in this sense that a cow is a holy animal. Not killing a cow simply means not doing any immoral act that dims that spiritual light.
Some scholars think the change in attitude towards eating beef (and meat) is due to the influence of Buddhism and Jainsim.