During industrialisation like a lot of things, we started to pasteurize with good intentions and saved millions of lives in the early nineteenth century.
At that time still didn’t understand how germs caused infectious disease such as Tuberculosis and Pneumonia, which were some of the leading causes of death. Added to this, the cities started growing rapidly, and food became a consumer commodity. Farmers had to figure out a way to feed millions of people in the cities, and also worry about extending the storage time of their produce.
Dairy farmers started to cram thousands of cows into feedlots which lead to poor sanitary conditions. Moreover milk exposed to open air attracted harmful bacteria and pathogens.
Health hazards due to milk during that time was on a increase. So milk was heated to high degrees within a short span, the process was called pasteurization, which drastically reduced diseases caused by raw milk.
Today we have the skills and knowledge, and the means to produce safe raw milk.
Maintaining healthy herd, hygienic farm condition, and chilling the milk immediately to 2-4 degrees drastically reduces the risk of pathogens and bad bacteria in milk.