In ancient India, donating cows was considered a noble deed. Buying cows with hereditary wealth and then donating them would earn a person salvation. Even donating cows bought from gambling money would earn a person a long prosperous life as per Mahabharata Anushasanaparva Chapter 73.