The issue is that the energy needed for the "hotel load" for the truck to run air conditioning, TV, etc. is very small compared to the size of the Diesel main engine (which is sized for propulsion, especially acceleration and going up a grade). Diesel engines use a roughly constant amount of fuel up to maybe 25-50% load, and then increase specific fuel use fairly slowly up to the efficient design level (which is probably highway cruise for most truck engines), and then increase specific fuel use much more quickly to peak power. (this depends a lot on the engine, and turbo/supercharged engines can have a wider band of efficiency)
By using an electric battery, and then charging it during normal use of the truck on-road, you change from a long duration inefficient use of the main engine, to a slight increase in power used during cruise (and it's a load which can be shut off instantly -- so you could run the charger during low-stress cruise, keeping the truck at maximum efficiency, or even run it entirely on regenerative braking in a future generation of the product).
Another option would be keeping a small Diesel APU on the truck to run rather than idling the main engine, but there are other benefits (noise, environmental) to the electric system. Given the right charging
The main penalty here is cost/complexity/weight of the system (which adds to fuel costs), but long-haul truckers pretty much sleep in their trucks every day, so it looks like it pays for itself quickly.
The other main system I've seen is "IdleAir" -- it's electricity, internet, and HVAC delivered by a flexible conduit into the truck. A central system at a truck stop provides it to all the trucks.
When I go on road trips (in a car), I've often wished for something similar -- I take breaks from driving every 2-4h, and sometimes to sleep overnight in rest stops, and being able to plug in and get power/internet/hvac without idling my car would be great. In some climates it's ok to sleep in a car without running HVAC, but in 130F sunlight, or -40F cold, that's not really an option.