Heater blocks are used on hot ends because they are the current engineering compromise between the design factors of cost, reliability, lifetime, maintenance, and performance.
Ideally, there would be no heater block, the heater would have infinite wattage, the nozzle would heat and cool instantly while transferring heat to the filament, and the temperature of the molten plastic would be measured instantly.
But as this is engineering instead of magic, none of these conditions is the ideal. The engineering problem is to find the right compromise.
Each of these can be treated separately. How do we measure the temperature of the plastic? Assume we have a tiny thermocouple in the plastic flow. Why thermocouple? Because it is smaller, less prone to manufacturing tolerance, and is good for higher temperatures.
Imagine a heater where the heater wire forms the threads into which the nozzle screws and also where the nozzle has thinner walls to reduce the nozzle's thermal mass. Further, the nozzle is made of diamond which has almost ten times the thermal conductivity of brass. Yes, machining diamond is not easy, and the supply of large enough diamonds is limited, but we're trying not to compromise yet.
In this scheme, there is no heater block. We instantly know the temperature of the plastic, and we can dump large amounts of heat into the system to get a high enough temperature. We still must hold the nozzle in place and connect it with the filament source (typically the job of the "heat break"), so let's make that of thermally insulating ceramic so it stays out of the heat transfer process.
With this, we have a hot-end where we would have great control. We are directly measuring the parameter we care about -- the temperature of the plastic. We can deliver heat rapidly. When the extrusion rate increases, the temperature drops a little and we dump in more heat. The thermocouple is fragile (don't try a cold-pull), and is subject to wear. The nozzle is very expensive and difficult to make.
Ok, move the thermocouple to the outside of the nozzle's tip. Now we have a heater intimately wrapped with the threads of the nozzle. That is probably hard to make, so let's use a conventional heater cartridge that is very close to the nozzle threads. Let's put in as many heaters as we can pack together near the threads. If we angle the heaters they won't hit each other, so suppose we can put in four heaters spaced around the nozzle. More heat, less distance from the heat to the nozzle. Make this new heat block of silver, just like the nozzle. Silver has 80% higher thermal conductivity than aluminum. (Or we could use diamond, but really, who has diamonds that big?)
I was assuming a thermocouple to measure the nozzle temperature, and it is small enough that it could nestle into a small home in the nozzle. We could use a thermister pressed into a hole in the nozzle, but experience has shown that thermisters are fragile. We have found that the tiny glass beads are prone to either breaking of the glass, separating from the thin leads. The electronics to measure temperature with a thermistor is simpler and less expensive than a thermocouple and seems to have good enough resolution, accuracy, and temperature range. If we follow that experience, we will package the thermistor in a cartridge housing that is easier and more reliably placed and protects the thermistor from damage. But the cartridge is too large to connect directly with the nozzle, so we'll put it in the same block with the heaters. After all, they are silver and conduct heat very well.
This may be a better hot-end than the conventional system. It heats faster and more accurately measures the temperature of the plastic. But there are problems. Silver is heavier, and four heaters and their wiring have more mass than one. And, the holes for the heater cartridges are each in a different plane, so it is more expensive to machine. And the price for the silver may be a factor. Silver costs (today) \$215/lb, where aluminum is $0.80/lb.
In this answer, I have tried to show how heater blocks are useful for coupling the heat from the heaters to the nozzle and to show that there are alternatives with perhaps superior performance but problems with reliability or cost.
Edit: In a comment, the OP asks why we do not machine away extra material that is not required to couple heat to the nozzle, and correctly raised the issue of cost. There may also be a performance issue.
The conventional heater is only on one side of the nozzle. When the heater is cooled by the filament, it draws heat from all sides. The thermal mass on the non-heated side helps with stability by providing a source of heat from which the nozzle can draw.
On the heater side, a factor to consider is the coupling of heat from the heater cartridge to the heater block. Removing additional material should be evaluated to assure that it does not increase the thermal resistance from the heater to the rest of the block and the thermistor. This is important to help with thermal stability, and also to assure that the heaters do not overheat themselves.
For thermal conductivity values, I used this reference.
For metals pricing, I used Google to find spot metal prices on 6/3/2019.