Why does cheese need boiling while paneer not?
(I'm in Germany, in case that is relevant)


Here, you can eat/drink most dairy products without boiling - with the exception of raw milk that is sold "has to be boiled before consumption".
Milk: possibly because in your country milk is usually sold raw?
Cheese: some recipes/processes call for boiling at various steps, e.g. for removing whey.
Not all cheese is made from pasteurized/boiled milk. And in particular fresh cheeses can spoil by mold or other microorganisms with which they can get contaminated after the cooking.  


There may also be regional differences in the prevalence of various diseases that mean that in some parts of the world you can skip the additional boiling steps while in other parts that comes at a high risk. TB comes to mind in that respect.



Milk:


The vast majority of milk that one can buy here is already pasteurized, so no further boiling is needed.
Raw milk can be sold/bought only if:


either the customer is told unambiguously that they should boil the milk. This is allowed only if the milk is sold directly at the farm.
so-called attested milk (Vorzugsmilch): here the farm is under a very strict hygiene and animal health regime and is therefore allowed to sell raw milk that is for raw consumption (I know that this possibility exists, but I've never consciously seen any such milk offered). 



Cheese:


In general, some cheeses are made from raw milk, while others are made from pasteurized/cooked milk. 
Whey cheeses are always prepared by cooking: the whey protein is the protein fraction that did not precipitate by acid (casein), it precipitates by heat. 
Many cheeses (as well as Qurk, yoghurt etc.) are made by adding particular microorganisms to the milk. This includes cheeses made from raw milk. "Bad" microorganisms that may be around in small quantities will at least be seriously outgrown by the "good" ones that are added.  Of course, processes starting with pasteurized/cooked milk are of still less concern.
So one difference between German Quark and Indian Paneer is that while both precipitate the protein (curdle the milk) by acid, for Quark the acid is produced by (lacto) bacteria rather than adding acid like lemon juice or vinegar (and AFAIK, both usually start from pasteurized or boiled milk). Because the milk is inoculated with these bacteria, we know they are "good" ones. 
The harder the cheese, i.e. the longer it did ripen, the safer: if a "bad" microorganism gets into the milk, that will become obvious long before the year or two of ripening is over.
Many hard cheeses also start with raw milk but have an intermediate step where they are heated to maybe 60 °C.
Fresh raw milk cheeses have again particular hygiene restrictions. Such cheese has also to be labeled as "made with raw milk", so e.g. pregnant women or people with compromised immune system can avoid them (toxoplasmosis and listeria risk) 
For immunocompetent (and not pregnant) people, the recommendation is that our senses are good at detecting if something is wrong with dairy products (exception is the raw milk for raw consumption). 
Around here, bovine tuberculosis is very rare nowadays (it basically only happens to happy cows out on a meadow who meet a coughing deer or if a farmer with TB infects their cow). In 2018, there were 63 cases of bovine tuberculosis among the 5429 tuberculosis cases (and 70 % of the tuberculosis patients are foreigners, but most farmers have German nationality). 
The vast majority of dairy products here is produced industrially and under industrial hygiene regulations.
The only exception are fresh cheeses like yoghurt or kefir that are home made from boiled milk that is then inoculated with the desired microorganisms.
I don't know anyone who still makes sour milk by hoping that the correct bacteria fall in (and the family tales do include stories of that way of making sour milk going wrong every once in a while, usually leading to some bitter slime). My yoghurt experience also includes that this can go wrong.
As I understand Indian Paneer, that is consumed really fresh. I.e., in contrast to Quark, there is no time needed to culture microorganisms. You boil the milk, add acid, get rid of the whey (in the cold) and it is ready to eat. This naturally leaves less time for contamination after the boiling and consecutive growth of microorganisms than keeping the stuff at a nice warm temperature for several hours before you start separating the whey.