I need a boiler to produce hot water for my bathroom. I wonder why boilers usually don't let you customize how much water they should contain. I only need to warm up 80 litres if there are guests in my house. Otherwise, 50 litres is more than enough. I think (maybe I'm wrong) this could greatly reduce energy bills, and I also think this should be quite easy to implement. So, what am I missing? Is there a specific technical reason why this is not implemented? Sorry if the question is dumb. :)
The most common reason is the difference in volume between water and steam; water expands to 1700 times its original volume during the phase transition. That makes steam engines capable of driving locomotives easily, but also makes steam boilers an explosion danger. Even in hot water "boilers" which don't produce steam need to be engineered for safety. You could easily lose an afternoon googling pictures of damage from hot water heater explosions.
Another common limitation is the design of the boiler itself. Most commonly the water is heated by a set of tubes inside the boiler. Generally the tubes themselves are designed to be cooled by the boiler water and must remain submerged. Lowering the water level exposes the tubes which can be weakened by the heat. In the absolute worst case if the tubes contain flames rather than water they can be heated to the temperature of the fire itself. If water is added it will instantly flash to steam with spectacular results. (Like over-pressuring so quickly not even the relief valve prevents an explosion.)
In general residential boilers have their design constrained by the need to be relatively safe and function unattended. You are right about the energy savings though, which is why you'll see more tankless types in new work. There are also hybrid styles designed for buildings which are too large for a tankless, which use a small tank combined with an on demand unit.