Why is there a need to use a transistor or an op amp in a sensor?
Many (most?) kinds of transducers are not capable by themselves to interface to the Real World. They produce rather "fragile" signals which must be amplified (or maybe at least "buffered") to maintain signal integrity perhaps over a long distance back to a controller, etc.
Or in many cases a local circuit is used to produce a "threshold calculation" to send a binary/digital signal. We don't really want to know what is the ambient light level. We only need to know whether the light beam is interrupted or not.